Author: sapient
Date: Mon Jul  2 02:37:11 2007
New Revision: 18612

URL: http://svn.gna.org/viewcvs/wesnoth?rev=18612&view=rev
Log:
making the menu::hit_column() loop prettier again (-1 line)

Modified:
    trunk/src/widgets/menu.cpp

Modified: trunk/src/widgets/menu.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/widgets/menu.cpp?rev=18612&r1=18611&r2=18612&view=diff
==============================================================================
--- trunk/src/widgets/menu.cpp (original)
+++ trunk/src/widgets/menu.cpp Mon Jul  2 02:37:11 2007
@@ -1004,9 +1004,8 @@
 int menu::hit_column(int x) const
 {
        std::vector<int> const &widths = column_widths();
-       x -= location().x;
-       int j, j_end = widths.size();
-       for(j = -1; x >= 0; x -= widths[j]) {
+       int j = -1, j_end = widths.size();
+       for(x -= location().x; x >= 0; x -= widths[j]) {
                if(++j == j_end) {
                        return -1;
                }


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to