Skip to content

Commit

Permalink
fix slice high is exclusive
Browse files Browse the repository at this point in the history
PDOK-16135
  • Loading branch information
roelarents committed Feb 15, 2024
1 parent 5a5d6b7 commit 5099490
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions snap/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ func dedupeInnersOuters(outers [][][2]float64, inners [][][2]float64) ([][][2]fl
}
if difference > 0 {
numToDelete := min(len(equalOutersIndexes), len(equalInnersIndexes))
indexesToDelete = append(indexesToDelete, equalOutersIndexes[0:numToDelete-1]...)
indexesToDelete = append(indexesToDelete, equalInnersIndexes[0:numToDelete-1]...)
indexesToDelete = append(indexesToDelete, equalOutersIndexes[0:numToDelete]...)
indexesToDelete = append(indexesToDelete, equalInnersIndexes[0:numToDelete]...)
}
}
newOuters := make([][][2]float64, 0, lenOuters)
Expand Down
2 changes: 1 addition & 1 deletion snap/snap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ func TestSnap_snapPolygon(t *testing.T) {
1: {
{
{{4.0, 124.0}, {4.0, 4.0}, {60.0, 4.0}, {60.0, 124.0}}, // ccw
{{28.0, 52.0}, {52.0, 52.0}, {52.0, 12.0}, {12.0, 12.0}, {12.0, 52.0}}, // cw
{{12.0, 116.0}, {52.0, 116.0}, {52.0, 76.0}, {28.0, 76.0}, {12.0, 76.0}}, // cw
{{28.0, 52.0}, {52.0, 52.0}, {52.0, 12.0}, {12.0, 12.0}, {12.0, 52.0}}, // cw
}, {
{{28.0, 44.0}, {20.0, 44.0}, {20.0, 20.0}, {44.0, 20.0}, {44.0, 44.0}}, // ccw
{{28.0, 36.0}, {36.0, 36.0}, {36.0, 28.0}, {28.0, 28.0}}, // cw
Expand Down

0 comments on commit 5099490

Please sign in to comment.