Bug 663631 - Simplify getParentIndex in folderPane.js and jsTreeView.js r=mconley
This commit is contained in:
Родитель
a53b08f4e1
Коммит
e34b8c20eb
|
@ -771,11 +771,7 @@ let gFolderTreeView = {
|
|||
* the child lists
|
||||
*/
|
||||
getParentIndex: function ftv_getParentIndex(aIndex) {
|
||||
for (let i = 0; i < this._rowMap.length; i++) {
|
||||
if (this._rowMap[i] == this._rowMap[aIndex]._parent)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
return this._rowMap.indexOf(this._rowMap[aIndex]._parent);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -90,11 +90,7 @@ PROTO_TREE_VIEW.prototype = {
|
|||
* the child lists
|
||||
*/
|
||||
getParentIndex: function jstv_getParentIndex(aIndex) {
|
||||
for (let i = 0; i < this._rowMap.length; i++) {
|
||||
if (this._rowMap[i] == this._rowMap[aIndex]._parent)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
return this._rowMap.indexOf(this._rowMap[aIndex]._parent);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче