Add comment explaining a V8 optimization.

Former-commit-id: 733f0985509467291287e1e0a95fcd22114cdbcf
This commit is contained in:
John-David Dalton
2012-06-19 11:42:27 +02:00
parent 93067c2d52
commit 6fa5b13e10
2 changed files with 62 additions and 61 deletions

View File

@@ -1425,7 +1425,8 @@
end = start || 0;
start = 0;
}
// use `Array(length)` so V8 will avoid the slower "dictionary" mode
// http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s
var index = -1,
length = Math.max(Math.ceil((end - start) / step), 0),
result = Array(length);