[Pkg-javascript-commits] [d3-tip.js] 142/277: d3's `each` seems to leak

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

bhuvan-guest pushed a commit to branch master
in repository d3-tip.js.

commit ca15179573d0b6c681bd3a06e15d0649699c3a4d
Author: Justin Palmer <justin at github.com>
Date:   Wed Apr 24 12:11:21 2013 -0700

    d3's `each` seems to leak
---
 examples/performance.html | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/examples/performance.html b/examples/performance.html
index df0ed71..e9da448 100644
--- a/examples/performance.html
+++ b/examples/performance.html
@@ -96,12 +96,14 @@
       .on('mouseover', tip.show)
       .on('mouseout', tip.hide)
 
+    var elements = circles[0],
+      length = elements.length
     e = new MouseEvent('mouseover')
     for(var i = 0; i <= RUNS; i++) {
+      var j = 0
       console.time(i)
-      circles.each(function() {
-        this.dispatchEvent(e)
-      })
+      for(j; j < length; j++)
+        elements[i].dispatchEvent(e)
       console.timeEnd(i)
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/d3-tip.js.git



More information about the Pkg-javascript-commits mailing list