mirror of https://github.com/PCSX2/pcsx2.git
boost ring queue: use % to wrap the index
For power of 2, it is replaced with a single and instruction. If it potentially faster than branch. But it worths a benchmark
This commit is contained in:
parent
725aaccf5c
commit
8779583bdb
|
@ -91,11 +91,12 @@ public:
|
||||||
{
|
{
|
||||||
size_t ret = arg + 1;
|
size_t ret = arg + 1;
|
||||||
#if 0
|
#if 0
|
||||||
|
// Initial boost code
|
||||||
while (unlikely(ret >= max_size))
|
while (unlikely(ret >= max_size))
|
||||||
#else
|
|
||||||
while (ret >= max_size)
|
|
||||||
#endif
|
|
||||||
ret -= max_size;
|
ret -= max_size;
|
||||||
|
#else
|
||||||
|
ret %= max_size;
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue