util: improve streams.h:FindByte() performance

Avoid use of the expensive mod operator (%) when calculating the
buffer offset. No functional difference.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
Larry Ruane
2020-08-10 15:23:03 -06:00
parent 604df63f6c
commit 72efc26439
5 changed files with 19 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ static void FindByte(benchmark::Bench& bench)
bench.run([&] {
bf.SetPos(0);
bf.FindByte(1);
bf.FindByte(std::byte(1));
});
// Cleanup