iconGrid: Remove unreachable code
Throwing an exception already aborts a function, so there's no need for a return statement in that case. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
This commit is contained in:
parent
4f76e05058
commit
37e0a73c8f
@ -906,10 +906,8 @@ var PaginatedIconGrid = GObject.registerClass({
|
|||||||
getItemPage(item) {
|
getItemPage(item) {
|
||||||
let children = this._getVisibleChildren();
|
let children = this._getVisibleChildren();
|
||||||
let index = children.indexOf(item);
|
let index = children.indexOf(item);
|
||||||
if (index == -1) {
|
if (index == -1)
|
||||||
throw new Error('Item not found.');
|
throw new Error('Item not found.');
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return Math.floor(index / this._childrenPerPage);
|
return Math.floor(index / this._childrenPerPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -924,10 +922,9 @@ var PaginatedIconGrid = GObject.registerClass({
|
|||||||
openExtraSpace(sourceItem, side, nRows) {
|
openExtraSpace(sourceItem, side, nRows) {
|
||||||
let children = this._getVisibleChildren();
|
let children = this._getVisibleChildren();
|
||||||
let index = children.indexOf(sourceItem.actor);
|
let index = children.indexOf(sourceItem.actor);
|
||||||
if (index == -1) {
|
if (index == -1)
|
||||||
throw new Error('Item not found.');
|
throw new Error('Item not found.');
|
||||||
return;
|
|
||||||
}
|
|
||||||
let pageIndex = Math.floor(index / this._childrenPerPage);
|
let pageIndex = Math.floor(index / this._childrenPerPage);
|
||||||
let pageOffset = pageIndex * this._childrenPerPage;
|
let pageOffset = pageIndex * this._childrenPerPage;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user