Merge pull request #3888 from Tyriar/3885

Prevent exception when deleting non-existent element
This commit is contained in:
Daniel Imms
2022-07-06 07:23:38 -07:00
committed by GitHub
+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;
}