projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b58555
)
Breaking out of evaluateAnnotations early if there are no annotations.
author
Anthony Robledo
<antrob@google.com>
Mon, 27 Jun 2011 18:49:09 +0000
(14:49 -0400)
committer
Anthony Robledo
<antrob@google.com>
Mon, 27 Jun 2011 18:49:09 +0000
(14:49 -0400)
This resulted in about an 8% speedup.
dygraph-layout.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph-layout.js
b/dygraph-layout.js
index
9c70965
..
99ae50c
100644
(file)
--- a/
dygraph-layout.js
+++ b/
dygraph-layout.js
@@
-222,6
+222,13
@@
DygraphLayout.prototype._evaluateAnnotations = function() {
}
this.annotated_points = [];
+
+ // Exit the function early if there are no annotations.
+ if (!this.annotations || !this.annotations.length) {
+ return;
+ }
+
+ // TODO(antrob): loop through annotations not points.
for (var i = 0; i < this.points.length; i++) {
var p = this.points[i];
var k = p.xval + "," + p.name;