Skip to content

Commit

Permalink
Remove unneeded check.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpmcmlxxvi committed Jun 2, 2019
1 parent 9dcfc58 commit 33c7f8e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/util/polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,8 @@ const isCoordinateSimilar = (coordinates1, coordinates2) => {
// First find a pair of coordinates that are equal then check rest of array
const length = coordinates1.length - 1;
for (let i = 0; i < length; ++i) {
// Search for similarity in forward direction
if (helpers.similar(coordinates1, coordinates2, 0, i, 1, true)) {
if (helpers.similar(coordinates1, coordinates2, 0, i, length, true)) {
return true;
}
}

// Search for similarity in reverse direction
if (helpers.similar(coordinates1, coordinates2, 0, i, 1, false)) {
if (helpers.similar(coordinates1, coordinates2, 0, i, length, false)) {
if (helpers.similar(coordinates1, coordinates2, 0, i, 1)) {
if (helpers.similar(coordinates1, coordinates2, 0, i, length)) {
return true;
}
}
Expand Down

0 comments on commit 33c7f8e

Please sign in to comment.