From fee1428f5459f72a19b27f2f6c9ca45daa63a2ac Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Thu, 18 Aug 2016 22:56:51 +0900 Subject: [PATCH] Don't calculate same hash multiple times --- content/treestyletab/content-utils.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/content-utils.js b/content/treestyletab/content-utils.js index bb89d5cc..da9affca 100644 --- a/content/treestyletab/content-utils.js +++ b/content/treestyletab/content-utils.js @@ -73,7 +73,9 @@ onLocationChange : function(aWebProgress, aRequest, aLocation, aFlags) { global.sendAsyncMessage(TreeStyleTabConstants.MESSAGE_TYPE, { command : TreeStyleTabConstants.COMMAND_REPORT_LOCATION_CHANGE, - locations : this.collectLocations(global.content) + locations : this.collectLocations(global.content).map(function(aURI) { + return this.getHashString(aURI); + }, this) }); }, onStatusChange : function() {}, @@ -88,7 +90,7 @@ collectLocations : function(aFrame, aLocations) { aLocations = aLocations || {}; - aLocations[this.getHashString(aFrame.location.href)] = true; + aLocations[aFrame.location.href] = true; Array.forEach(aFrame.frames, function(aSubFrame) { this.collectLocations(aSubFrame, aLocations); }, this);