Closed saby1101 closed 9 years ago
Thank you for catching this:
Instead of redeclaring the range
every iteration, please pull the range
declaration out of the loop to the top of the method. Will accept PR then!
function increaseRangeBitDepth(ranges, radiusBitDepth, bitDepth) {
var bitDiff = bitDepth - radiusBitDepth;
var range;
for (var i = 0; i < ranges.length; i++) {
range = ranges[i];
range[0] = leftShift(range[0], bitDiff);
range[1] = leftShift(range[1], bitDiff);
}
}
I don't think it matters. Look at this..http://stackoverflow.com/questions/3684923/javascript-variables-declare-outside-or-inside-loop. Anyways thanks for fixing the bug. Keep up the good work. Cheers!
-----Original Message----- From: "Arjun Mehta" notifications@github.com Sent: 7/23/2015 7:22 AM To: "arjunmehta/node-geo-proximity" node-geo-proximity@noreply.github.com Cc: "Sabyasachi Bhattacharjee" sbhatt.iitk@gmail.com Subject: Re: [node-geo-proximity] Unnecessary global variables. (#17)
function increaseRangeBitDepth(ranges, radiusBitDepth, bitDepth) {
var bitDiff = bitDepth - radiusBitDepth;
var range;
for (var i = 0; i < ranges.length; i++) {
range = ranges[i];
range[0] = leftShift(range[0], bitDiff);
range[1] = leftShift(range[1], bitDiff);
}
}— Reply to this email directly or view it on GitHub.
Thanks!!
Yeah, it's more convention than anything else. I will probably add an .eslintrc file to the project soon! :)
Cool
Published. Thanks again.
module was failing when run with '--use-strict' flag.