-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make probe::dis O(n^2) instead of O(n^3) with some iterators
probe::dis was accidentally O(n^3) with forward iterators and bidirectional iterators. This commit changes the algorithm a bit to avoid a lot of unnecessary calls to std::distance, and gives it its marketed O(n^2) complexity for all categories of iterators. Loosely related to issue #169.
- Loading branch information
Showing
1 changed file
with
9 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters