Comments in Collection#_onUpdate().
This commit is contained in:
parent
de6cbb0f45
commit
aebd9319f5
@ -99,14 +99,14 @@ export default class Index {
|
|||||||
|
|
||||||
const prev = keysToHash[key]
|
const prev = keysToHash[key]
|
||||||
const hash = computeHash(value, key)
|
const hash = computeHash(value, key)
|
||||||
if (hash === prev) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prev != null) {
|
// Same hash, nothing to do.
|
||||||
delete itemsByHash[prev][key]
|
if (hash === prev) continue
|
||||||
}
|
|
||||||
|
|
||||||
|
// Removes item from the previous hash's list if any.
|
||||||
|
if (prev != null) delete itemsByHash[prev][key]
|
||||||
|
|
||||||
|
// Inserts item into the new hash's list if any.
|
||||||
if (hash != null) {
|
if (hash != null) {
|
||||||
(
|
(
|
||||||
itemsByHash[hash] ||
|
itemsByHash[hash] ||
|
||||||
|
Loading…
Reference in New Issue
Block a user