Comments in Collection#_onUpdate().

This commit is contained in:
Julien Fontanet 2015-04-29 13:17:31 +02:00
parent de6cbb0f45
commit aebd9319f5

View File

@ -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] ||