Merge lp:~ab-tools/widelands/msvs2010-compileerrors into lp:widelands

Proposed by Andreas Breitschopp
Status: Merged
Merged at revision: 6402
Proposed branch: lp:~ab-tools/widelands/msvs2010-compileerrors
Merge into: lp:widelands
Diff against target: 24 lines (+1/-6)
1 file modified
src/logic/world.cc (+1/-6)
To merge this branch: bzr merge lp:~ab-tools/widelands/msvs2010-compileerrors
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+109493@code.launchpad.net

Description of the change

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. ;-)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
859 uint32_t i = 0;859 uint32_t i = 0;
860 int32_t cur_res = 0;860 int32_t cur_res = 0;
861 while (i <= str1.size()) {861 while (i <= str1.size()) {
862 if (i != str1.size() &&
863 (str1[i] == ' ' || str1[i] == ' ' || str1[i] == '\t')) {
864 ++i;
865 continue;
866 }
867 if (i == str1.size() || str1[i] == ',') {862 if (i == str1.size() || str1[i] == ',') {
868 const int32_t res = resources->get_index(curres.c_str());;863 const int32_t res = resources->get_index(curres.c_str());;
869 if (res == -1)864 if (res == -1)
@@ -873,7 +868,7 @@
873 s->get_name(), curres.c_str());868 s->get_name(), curres.c_str());
874 m_valid_resources[cur_res++] = res;869 m_valid_resources[cur_res++] = res;
875 curres = "";870 curres = "";
876 } else871 } else if (str1[i] != ' ' && str1[i] != '\t')
877 curres.append(1, str1[i]);872 curres.append(1, str1[i]);
878 ++i;873 ++i;
879 }874 }

Subscribers

People subscribed via source and target branches

to status/vote changes: