Prevent exception when deleting non-existent element

Fixes #3885
This commit is contained in:
Daniel Imms
2022-07-06 04:39:12 -07:00
parent 915fa49ce3
commit 098b2252d0
+3
View File
@@ -35,6 +35,9 @@ export class SortedList<T> {
}
const key = this._getKey(value);
let i = this._search(key, 0, this._array.length - 1);
if (i === -1) {
return false;
}
if (this._getKey(this._array[i]) !== key) {
return false;
}