From c31f70bf084a1e4124f13c2b0854c043705583c6 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 27 Feb 2014 12:01:14 +0100 Subject: [PATCH] Remove unused ol.format.Polyline.encodeSignedInteger function --- src/ol/format/polylineformat.js | 12 ------------ test/spec/ol/format/polylineformat.test.js | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/ol/format/polylineformat.js b/src/ol/format/polylineformat.js index a30d20eaea..34720b105f 100644 --- a/src/ol/format/polylineformat.js +++ b/src/ol/format/polylineformat.js @@ -237,18 +237,6 @@ ol.format.Polyline.decodeUnsignedIntegers = function(encoded) { }; -/** - * Encode one single signed integer and return an encoded string - * - * @param {number} num Signed integer that should be encoded. - * @return {string} The encoded string. - */ -ol.format.Polyline.encodeSignedInteger = function(num) { - var signedNum = (num < 0) ? ~(num << 1) : (num << 1); - return ol.format.Polyline.encodeUnsignedInteger(signedNum); -}; - - /** * Encode one single unsigned integer and return an encoded string * diff --git a/test/spec/ol/format/polylineformat.test.js b/test/spec/ol/format/polylineformat.test.js index d8689d30b5..6394adf04f 100644 --- a/test/spec/ol/format/polylineformat.test.js +++ b/test/spec/ol/format/polylineformat.test.js @@ -188,19 +188,19 @@ describe('ol.format.Polyline', function() { describe('encodeSignedInteger', function() { it('returns expected value', function() { - var encodeSignedInteger = ol.format.Polyline.encodeSignedInteger; + var encodeSignedIntegers = ol.format.Polyline.encodeSignedIntegers; - expect(encodeSignedInteger(0)).to.eql('?'); - expect(encodeSignedInteger(-1)).to.eql('@'); - expect(encodeSignedInteger(1)).to.eql('A'); - expect(encodeSignedInteger(-2)).to.eql('B'); - expect(encodeSignedInteger(2)).to.eql('C'); - expect(encodeSignedInteger(15)).to.eql(']'); - expect(encodeSignedInteger(-16)).to.eql('^'); + expect(encodeSignedIntegers([0])).to.eql('?'); + expect(encodeSignedIntegers([-1])).to.eql('@'); + expect(encodeSignedIntegers([1])).to.eql('A'); + expect(encodeSignedIntegers([-2])).to.eql('B'); + expect(encodeSignedIntegers([2])).to.eql('C'); + expect(encodeSignedIntegers([15])).to.eql(']'); + expect(encodeSignedIntegers([-16])).to.eql('^'); - expect(encodeSignedInteger(16)).to.eql('_@'); - expect(encodeSignedInteger(16 * 32)).to.eql('__@'); - expect(encodeSignedInteger(16 * 32 * 32)).to.eql('___@'); + expect(encodeSignedIntegers([16])).to.eql('_@'); + expect(encodeSignedIntegers([16 * 32])).to.eql('__@'); + expect(encodeSignedIntegers([16 * 32 * 32])).to.eql('___@'); }); });