summaryrefslogtreecommitdiff
path: root/src/MinOverlapPlacement.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/MinOverlapPlacement.cc')
-rw-r--r--src/MinOverlapPlacement.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/MinOverlapPlacement.cc b/src/MinOverlapPlacement.cc
index cea4f51..559ff11 100644
--- a/src/MinOverlapPlacement.cc
+++ b/src/MinOverlapPlacement.cc
@@ -79,8 +79,9 @@ bool MinOverlapPlacement::placeWindow(const FluxboxWindow &win, int head,
79 // at the end, we'll find the one with minimum overlap 79 // at the end, we'll find the one with minimum overlap
80 // the size of this set is at most 2(n+2)(n+1) (n = number of windows) 80 // the size of this set is at most 2(n+2)(n+1) (n = number of windows)
81 // finding overlaps is therefore O(n^3), but it can probably be improved 81 // finding overlaps is therefore O(n^3), but it can probably be improved
82 std::list<FluxboxWindow *>::const_reverse_iterator it = windowlist.rbegin(), 82 const std::list<FluxboxWindow* >& const_windowlist = windowlist;
83 it_end = windowlist.rend(); 83 std::list<FluxboxWindow *>::const_reverse_iterator it = const_windowlist.rbegin(),
84 it_end = const_windowlist.rend();
84 for (; it != it_end; ++it) { 85 for (; it != it_end; ++it) {
85 if (*it == &win) continue; 86 if (*it == &win) continue;
86 87
@@ -154,7 +155,7 @@ bool MinOverlapPlacement::placeWindow(const FluxboxWindow &win, int head,
154 for (; reg_it != region_set.end(); ++reg_it) { 155 for (; reg_it != region_set.end(); ++reg_it) {
155 156
156 int overlap = 0; 157 int overlap = 0;
157 it = windowlist.rbegin(); 158 it = const_windowlist.rbegin();
158 for (; it != it_end; ++it) { 159 for (; it != it_end; ++it) {
159 160
160 // get the dimensions of the window 161 // get the dimensions of the window