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
1=== modified file 'src/logic/world.cc'
2--- src/logic/world.cc 2012-06-08 12:50:14 +0000
3+++ src/logic/world.cc 2012-06-09 20:25:25 +0000
4@@ -859,11 +859,6 @@
5 uint32_t i = 0;
6 int32_t cur_res = 0;
7 while (i <= str1.size()) {
8- if (i != str1.size() &&
9- (str1[i] == ' ' || str1[i] == ' ' || str1[i] == '\t')) {
10- ++i;
11- continue;
12- }
13 if (i == str1.size() || str1[i] == ',') {
14 const int32_t res = resources->get_index(curres.c_str());;
15 if (res == -1)
16@@ -873,7 +868,7 @@
17 s->get_name(), curres.c_str());
18 m_valid_resources[cur_res++] = res;
19 curres = "";
20- } else
21+ } else if (str1[i] != ' ' && str1[i] != '\t')
22 curres.append(1, str1[i]);
23 ++i;
24 }

Subscribers

People subscribed via source and target branches

to status/vote changes: