mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Add a note about low-hanging optimisation fruit
This commit is contained in:
@@ -162,6 +162,10 @@ int bitscanforward(int source)
|
||||
int success = __builtin_ffs(source);
|
||||
return success - 1;
|
||||
#else
|
||||
#pragma message "Falling back to iterative bitscan forward, consider using intrinsics"
|
||||
// This is a low-hanging optimisation boost, check if your compiler offers
|
||||
// any intrinsic.
|
||||
// cf. https://github.com/OpenRCT2/OpenRCT2/pull/2093
|
||||
for (i = 0; i < 32; i++)
|
||||
if (source & (1u << i))
|
||||
return i;
|
||||
|
||||
Reference in New Issue
Block a user