diff src/roadveh_cmd.cpp @ 7516:57448343fd4a draft

(svn r11031) -Codechange: reduce the amount of duplication of bit counting functions. Based on patches by skidd13, SmatZ and Belugas.
author rubidium <rubidium@openttd.org>
date Sat, 01 Sep 2007 08:31:36 +0000 (2007-09-01)
parents 2250b8ea9466
children b8e1d03b1e83
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1083,7 +1083,7 @@
 static int PickRandomBit(uint bits)
 {
 	uint i;
-	uint num = RandomRange(CountBitsSet(bits));
+	uint num = RandomRange(COUNTBITS(bits));
 
 	for (i = 0; !(bits & 1) || (int)--num >= 0; bits >>= 1, i++) {}
 	return i;