From d02eb93c8ac36d3d975e2ce82179de094c6b5c12 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sun, 5 Feb 2012 04:03:28 +0900 Subject: [PATCH] use Iterator instead of forEach (for performance optimization) --- modules/utils.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/utils.js b/modules/utils.js index 90480306..cf503eb5 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -952,12 +952,10 @@ var TreeStyleTabUtils = { var event = document.createEvent('DataContainerEvent'); event.initEvent(type, canBubble, cancellable); - for (let i in data) + for (let [property, value] in Iterator(data)) { - if (!data.hasOwnProperty(i)) - continue; - event.setData(i, data[i]); - event[i] = data[i]; // for backward compatibility + event.setData(property, value); + event[property] = value; // for backward compatibility } return target.dispatchEvent(event);