diff options
author | truelight <truelight@openttd.org> | 2007-07-24 12:29:47 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-07-24 12:29:47 +0000 |
commit | e66ab3b6f1343968730b9a7069376f5408fb6d4d (patch) | |
tree | 21e3927db5edb8482b500ece56bafad8f2cbbe56 /src | |
parent | 0bc5d4b768b4eb6730bdf8e8593a9e9dcbb9ec32 (diff) | |
download | openttd-e66ab3b6f1343968730b9a7069376f5408fb6d4d.tar.xz |
(svn r10671) -Codechange: don't mix both lookup and temp-variable-with-value-of-lookup (skidd13)
Diffstat (limited to 'src')
-rw-r--r-- | src/strings.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 03ee082b8..4ea1bc273 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -241,7 +241,7 @@ static const uint32 _divisor_table[] = { // TODO static char *FormatCommaNumber(char *buff, int32 number, const char* last) { - uint32 quot,divisor; + uint32 quot; int i; uint32 tot; uint32 num; @@ -255,9 +255,8 @@ static char *FormatCommaNumber(char *buff, int32 number, const char* last) tot = 0; for (i = 0; i != 10; i++) { - divisor = _divisor_table[i]; quot = 0; - if (num >= divisor) { + if (num >= _divisor_table[i]) { quot = num / _divisor_table[i]; num = num % _divisor_table[i]; } @@ -275,7 +274,7 @@ static char *FormatCommaNumber(char *buff, int32 number, const char* last) // TODO static char *FormatNoCommaNumber(char *buff, int32 number, const char* last) { - uint32 quot,divisor; + uint32 quot; int i; uint32 tot; uint32 num; @@ -289,9 +288,8 @@ static char *FormatNoCommaNumber(char *buff, int32 number, const char* last) tot = 0; for (i = 0; i != 10; i++) { - divisor = _divisor_table[i]; quot = 0; - if (num >= divisor) { + if (num >= _divisor_table[i]) { quot = num / _divisor_table[i]; num = num % _divisor_table[i]; } |