diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2019-04-23 15:42:24 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2019-04-26 11:38:44 +0300 |
commit | 4d7c0819ff9e4b815b5f5099bcbaa58ed424ee32 (patch) | |
tree | 6b8d8936aad47b3ed43e95e3c85b040f79d31b59 /openlr/openlr_decoder.cpp | |
parent | c54c154b72a1a9fee86e72b4557042fbb9c8b18c (diff) |
Review fixes.
Diffstat (limited to 'openlr/openlr_decoder.cpp')
-rw-r--r-- | openlr/openlr_decoder.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openlr/openlr_decoder.cpp b/openlr/openlr_decoder.cpp index 151b89bcbf..3b3bcc0d03 100644 --- a/openlr/openlr_decoder.cpp +++ b/openlr/openlr_decoder.cpp @@ -167,13 +167,13 @@ void ExpandFakes(DataSource const & dataSource, Graph & g, Graph::EdgeVector & p // Returns an iterator pointing to the first edge that should not be cut off. // Offsets denote a distance in meters one should travel from the start/end of the path -// to some point alog that path and drop everything form the start to that point or from +// to some point along that path and drop everything form the start to that point or from // that point to the end. template <typename InputIterator> InputIterator CutOffset(InputIterator start, InputIterator stop, double offset, - bool keepEnds) + bool keepEnd) { - if (offset == 0) + if (offset == 0.0) return start; for (double distance = 0.0; start != stop; ++start) @@ -181,8 +181,8 @@ InputIterator CutOffset(InputIterator start, InputIterator stop, double offset, auto const edgeLen = EdgeLength(*start); if (distance <= offset && offset < distance + edgeLen) { - // Throw out this edge if (offest - distance) is greater than edgeLength / 2. - if (!keepEnds && 2 * (offset - distance) >= edgeLen) + // Throw out this edge if (offset - distance) is greater than edgeLength / 2. + if (!keepEnd && offset - distance >= edgeLen / 2.0) ++start; break; } |