Optimize encode

This commit is contained in:
Tobias Bieniek authored and Tom Payne committed 2013-12-17 12:59:58 +01:00
1 parent d187849838
commit 36a5a53ba2
1 file changed
+1 -8
+1 -8
View File
@@ -171,15 +171,8 @@ ol.format.Polyline.encodeSignedIntegers = function(numbers) {
var i, ii;
for (i = 0, ii = numbers.length; i < ii; ++i) {
var num = numbers[i];
var signedNum = num << 1;
if (num < 0) {
signedNum = ~(signedNum);
}
numbers[i] = signedNum;
numbers[i] = (num < 0) ? ~(num << 1) : (num << 1);
}
return ol.format.Polyline.encodeUnsignedIntegers(numbers);
};