From 5593eb94d0fa255afe10809b3408211432ab775a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 14 May 2011 18:11:31 +0100 Subject: [PATCH] Simplify Item#_removeFromParent(). --- src/item/Item.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index e5854f7f..29f68ae6 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -294,11 +294,9 @@ var Item = this.Item = Base.extend({ */ _removeFromParent: function() { if (this._parent) { - var ok = !!Base.splice(this._parent._children, null, - this._index, 1).length; - this._parent = null; - this._index = null; - return ok; + var res = Base.splice(this._parent._children, null, this._index, 1); + this._parent = this._index = null; + return !!res.length; } return false; },