mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Prefer pre-inc/dec unless post-inc/dec are necessary
This commit is contained in:
@@ -71,7 +71,7 @@ static inline int ctz(unsigned int x) {
|
||||
|
||||
while (!(x & 1)) {
|
||||
x >>= 1;
|
||||
cnt++;
|
||||
++cnt;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ static inline int clz(unsigned int x) {
|
||||
|
||||
while (x <= UINT_MAX / 2) {
|
||||
x <<= 1;
|
||||
cnt++;
|
||||
++cnt;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user