From d925d2afdcb49942603236d3a21484471711c079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 18 Dec 2014 19:43:36 +0100 Subject: UScreen: cleanup code in GetMonitorAtPosition (bzr r3884.9.5) --- unity-shared/UScreen.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'unity-shared') diff --git a/unity-shared/UScreen.cpp b/unity-shared/UScreen.cpp index 976f2dbcb..6165ddf8b 100644 --- a/unity-shared/UScreen.cpp +++ b/unity-shared/UScreen.cpp @@ -74,13 +74,10 @@ int UScreen::GetPrimaryMonitor() const int UScreen::GetMonitorAtPosition(int x, int y) const { - int idx = 0; - - for (auto const& monitor : monitors_) + for (unsigned i = 0; i < monitors_.size(); ++i) { - if (monitor.IsPointInside(x, y)) - return idx; - ++idx; + if (monitors_[i].IsPointInside(x, y)) + return i; } return gdk_screen_get_monitor_at_point(screen_, x, y); -- cgit v1.2.3