Better variables scoping

This commit is contained in:
Frederic Junod
2018-01-17 16:07:36 +01:00
parent 4a6331377f
commit 039d4dc714
22 changed files with 74 additions and 134 deletions

View File

@@ -74,9 +74,8 @@ Atlas.prototype.get = function(id) {
* @return {?ol.AtlasInfo} The position and atlas image for the entry.
*/
Atlas.prototype.add = function(id, width, height, renderCallback, opt_this) {
let block, i, ii;
for (i = 0, ii = this.emptyBlocks_.length; i < ii; ++i) {
block = this.emptyBlocks_[i];
for (let i = 0, ii = this.emptyBlocks_.length; i < ii; ++i) {
const block = this.emptyBlocks_[i];
if (block.width >= width + this.space_ &&
block.height >= height + this.space_) {
// we found a block that is big enough for our entry

View File

@@ -109,10 +109,9 @@ AtlasManager.prototype.getInfo = function(id) {
* or `null` if the entry is not part of the atlases.
*/
AtlasManager.prototype.getInfo_ = function(atlases, id) {
let atlas, info, i, ii;
for (i = 0, ii = atlases.length; i < ii; ++i) {
atlas = atlases[i];
info = atlas.get(id);
for (let i = 0, ii = atlases.length; i < ii; ++i) {
const atlas = atlases[i];
const info = atlas.get(id);
if (info) {
return info;
}