Open MiloBem opened 6 years ago
Stable SortedArray should always add a new element at the end of the subsequence of elements for which compare to returns 0. It doesn't:
let a = new SortedArray(null, null, function(a, b) { return a.k - b.k; }); a.push({ k: 5, v: "a" }); a.push({ k: 5, v: "c" }); a.push({ k: 5, v: "e" }); console.log("bla:" + JSON.stringify(a.toArray()));
result: [{"k":5,"v":"c"},{"k":5,"v":"e"},{"k":5,"v":"a"}]
[{"k":5,"v":"c"},{"k":5,"v":"e"},{"k":5,"v":"a"}]
Stable SortedArray should always add a new element at the end of the subsequence of elements for which compare to returns 0. It doesn't:
result:
[{"k":5,"v":"c"},{"k":5,"v":"e"},{"k":5,"v":"a"}]