Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6293d5

Browse files
John Soklaskietpinard
John Soklaski
authored andcommitted
Fix off by one error in flattenUniqueSort
1 parent a0a9bb2 commit d6293d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plots/cartesian/ordered_categories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function flattenUniqueSort(axisLetter, sortFunction, data) {
4141
insertionIndex = bisector(categoryArray, category);
4242

4343
// skip loop on already encountered values
44-
if(insertionIndex < categoryArray.length - 1 && categoryArray[insertionIndex] === category) continue;
44+
if(insertionIndex < categoryArray.length && categoryArray[insertionIndex] === category) continue;
4545

4646
// insert value
4747
categoryArray.splice(insertionIndex, 0, category);

0 commit comments

Comments
 (0)