Improve readability with local variable

This commit is contained in:
Pavle Goloskokovic 2017-11-30 18:56:12 +01:00
parent 9a156ec898
commit 5c3a3ebef2

View file

@ -12,10 +12,11 @@ var WebAudioSpriteSound = new Class({
*/ */
this.spritemap = manager.game.cache.json.get(key).spritemap; this.spritemap = manager.game.cache.json.get(key).spritemap;
for (var markerName in this.spritemap) { for (var markerName in this.spritemap) {
var marker = this.spritemap[markerName];
this.addMarker({ this.addMarker({
name: markerName, name: markerName,
start: this.spritemap[markerName].start, start: marker.start,
duration: this.spritemap[markerName].end - this.spritemap[markerName].start, duration: marker.end - marker.start,
config: config config: config
}); });
} }