Skip to content

Commit

Permalink
Due to a bug in node.js 4.3, we need to declare and init on separate …
Browse files Browse the repository at this point in the history
  • Loading branch information
famzah committed Oct 18, 2016
1 parent 5e9048e commit 6716271
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion primes.js
Expand Up @@ -25,7 +25,11 @@ function get_primes7(n) {
m = 2*i + 3;
}

var res = [2];
// due to a bug in node.js 4.3, we need to declare and init on separate lines
// or else node.js performs about four times slower
var res = [];
res.push(2);

for (var x = 0; x < s.length; x++) {
if (s[x]) {
res.push(s[x]);
Expand Down

0 comments on commit 6716271

Please sign in to comment.