Andreas Breitschopp has proposed merging 
lp:~ab-tools/widelands/msvs2010-compileerrors into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~ab-tools/widelands/msvs2010-compileerrors/+merge/109493

I've now fixed the CodeCheck issues reported by Peter Waller by simplifying the 
code.

This way the if condition is much easier to read and also CodeCheck should be 
happy, too. ;-)
-- 
https://code.launchpad.net/~ab-tools/widelands/msvs2010-compileerrors/+merge/109493
Your team Widelands Developers is requested to review the proposed merge of 
lp:~ab-tools/widelands/msvs2010-compileerrors into lp:widelands.
=== modified file 'src/logic/world.cc'
--- src/logic/world.cc	2012-06-08 12:50:14 +0000
+++ src/logic/world.cc	2012-06-09 20:25:25 +0000
@@ -859,11 +859,6 @@
 		uint32_t i = 0;
 		int32_t cur_res = 0;
 		while (i <= str1.size()) {
-			if (i != str1.size() &&
-					(str1[i] == ' ' || str1[i] == ' ' || str1[i] == '\t')) {
-				++i;
-				continue;
-			}
 			if (i == str1.size() || str1[i] == ',') {
 				const int32_t res = resources->get_index(curres.c_str());;
 				if (res == -1)
@@ -873,7 +868,7 @@
 						 s->get_name(), curres.c_str());
 				m_valid_resources[cur_res++] = res;
 				curres = "";
-			} else
+			} else if (str1[i] != ' ' && str1[i] != '\t')
 				curres.append(1, str1[i]);
 			++i;
 		}

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to