From aebd9319f5e2e4cc5dc519dfb6fc39f66157b279 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 29 Apr 2015 13:17:31 +0200 Subject: [PATCH] Comments in Collection#_onUpdate(). --- packages/xo-collection/src/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/xo-collection/src/index.js b/packages/xo-collection/src/index.js index 3a321e619..5fb4b9392 100644 --- a/packages/xo-collection/src/index.js +++ b/packages/xo-collection/src/index.js @@ -99,14 +99,14 @@ export default class Index { const prev = keysToHash[key] const hash = computeHash(value, key) - if (hash === prev) { - continue - } - if (prev != null) { - delete itemsByHash[prev][key] - } + // Same hash, nothing to do. + 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) { ( itemsByHash[hash] ||