Allow better code compression by removing repeated variable access on this.

This commit is contained in:
Jürg Lehni 2014-09-27 22:00:46 +02:00
parent 35a02f3dd8
commit 8b4f59962e

View file

@ -85,14 +85,15 @@ var Layer = Group.extend(/** @lends Layer# */{
if (this._parent)
return _remove.base.call(this, notify);
if (this._index != null) {
if (this._project.activeLayer === this)
this._project.activeLayer = this.getNextSibling()
var project = this._project;
if (project.activeLayer === this)
project.activeLayer = this.getNextSibling()
|| this.getPreviousSibling();
Base.splice(this._project.layers, null, this._index, 1);
Base.splice(project.layers, null, this._index, 1);
this._installEvents(false);
// Tell project we need a redraw. This is similar to _changed()
// mechanism.
this._project._needsUpdate = true;
project._needsUpdate = true;
return true;
}
return false;