(svn r10671) -Codechange: don't mix both lookup and temp-variable-with-value-of-lookup (skidd13)
authortruelight
Tue, 24 Jul 2007 12:29:47 +0000
changeset 7812 9e652ca4827b
parent 7811 306c5f3a8e37
child 7813 49fbe41f8a04
(svn r10671) -Codechange: don't mix both lookup and temp-variable-with-value-of-lookup (skidd13)
src/strings.cpp
--- a/src/strings.cpp	Tue Jul 24 01:29:42 2007 +0000
+++ b/src/strings.cpp	Tue Jul 24 12:29:47 2007 +0000
@@ -241,7 +241,7 @@
 // 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 @@
 
 	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 @@
 // 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 @@
 
 	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];
 		}