Remove unused variables in structs

This commit is contained in:
Tom Payne
2013-05-21 12:49:40 +02:00
parent 8b539cd4cc
commit f4d54ace1d
3 changed files with 3 additions and 2 deletions

View File

@@ -80,7 +80,6 @@ ol.structs.IntegerSet.prototype.compactRanges_ = function() {
var arr = this.arr_; var arr = this.arr_;
var n = arr.length; var n = arr.length;
var rangeIndex = 0; var rangeIndex = 0;
var lastRange = null;
var i; var i;
for (i = 0; i < n; i += 2) { for (i = 0; i < n; i += 2) {
if (arr[i] == arr[i + 1]) { if (arr[i] == arr[i + 1]) {

View File

@@ -26,12 +26,14 @@ describe('ol.structs.IntegerSet', function() {
it('throws an exception with an odd number of elements', function() { it('throws an exception with an odd number of elements', function() {
expect(function() { expect(function() {
var is = new ol.structs.IntegerSet([0, 2, 4]); var is = new ol.structs.IntegerSet([0, 2, 4]);
is = is; // suppress gjslint warning about unused variable
}).to.throwException(); }).to.throwException();
}); });
it('throws an exception with out-of-order elements', function() { it('throws an exception with out-of-order elements', function() {
expect(function() { expect(function() {
var is = new ol.structs.IntegerSet([0, 2, 2, 4]); var is = new ol.structs.IntegerSet([0, 2, 2, 4]);
is = is; // suppress gjslint warning about unused variable
}).to.throwException(); }).to.throwException();
}); });

View File

@@ -82,7 +82,7 @@ describe('ol.structs.PriorityQueue', function() {
pq = new ol.structs.PriorityQueue(function(element) { pq = new ol.structs.PriorityQueue(function(element) {
return Math.abs(element - target); return Math.abs(element - target);
}, goog.identityFunction); }, goog.identityFunction);
var element, i; var i;
for (i = 0; i < 32; ++i) { for (i = 0; i < 32; ++i) {
pq.enqueue(Math.random()); pq.enqueue(Math.random());
} }