montagejs / collections

This package contains JavaScript implementations of common data structures with idiomatic interfaces.
http://www.collectionsjs.com
Other
2.09k stars 185 forks source link

iterate(start, end) returns entire set if the range is beyond the set #201

Open hhanh00 opened 6 years ago

hhanh00 commented 6 years ago
const SortedSet = require('collections/sorted-set')

let set = new SortedSet([-10, -9])
let iterable = {
  [Symbol.iterator]: () => set.iterate(0.01, 4)
}
for (const a of iterable) {
  console.log(a)
}

should not print anything, instead prints out the entire set

-10
-9