rename SortedArray.replace to update

This commit is contained in:
Bruno Windels 2021-04-08 18:36:09 +02:00
parent d8d97c40f7
commit f976eeaf13
2 changed files with 5 additions and 3 deletions

View file

@ -76,7 +76,9 @@ export class Timeline {
replaceEntries(entries) {
for (const entry of entries) {
this._remoteEntries.replace(entry);
// this will use the comparator and thus
// check for equality using the compare method in BaseEntry
this._remoteEntries.update(entry);
}
}

View file

@ -41,11 +41,11 @@ export class SortedArray extends BaseObservableList {
}
}
replace(item) {
update(item, updateParams = null) {
const idx = this.indexOf(item);
if (idx !== -1) {
this._items[idx] = item;
this.emitUpdate(idx, item, null);
this.emitUpdate(idx, item, updateParams);
}
}