[gnome-shell] appDisplay: Don't iterate over all pages in page manager
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] appDisplay: Don't iterate over all pages in page manager
- Date: Tue, 15 Sep 2020 09:37:54 +0000 (UTC)
commit 92d3c6e051958b31151bf9538205a71cab6f70d7
Author: Daniel García Moreno <daniel endlessm com>
Date: Thu Sep 10 16:30:15 2020 +0200
appDisplay: Don't iterate over all pages in page manager
In getAppPosition it's not needed to continue looking for an app in the
page manager if the app is found in a page.
This patch breaks the search loop just after the first ocurrence is
found.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1434
js/ui/appDisplay.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index cecf6d185b..68fdbdd0e7 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -851,11 +851,11 @@ var PageManager = GObject.registerClass({
for (let pageIndex = 0; pageIndex < this._pages.length; pageIndex++) {
const pageData = this._pages[pageIndex];
- if (!(appId in pageData))
- continue;
-
- page = pageIndex;
- position = pageData[appId].position;
+ if (appId in pageData) {
+ page = pageIndex;
+ position = pageData[appId].position;
+ break;
+ }
}
return [page, position];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]