this._nextId = 1;
if (snapshot && Array.isArray(snapshot.items)) {
if (isValidEntry(e)) {
this._items.push(e);
}
}
// Restored ids must not collide with future adds.
for (const e of this._items) {
if (e.id >= this._nextId) {
this._nextId = e.id + 1;
}
}
this._evictIfNeeded();
}
this._onDidChange.fire();
}