Bitmap: short circuit on 0-byte clears

This commit is contained in:
apio 2022-12-07 14:32:41 +01:00
parent cbf061d18f
commit 3248041aef
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -62,6 +62,8 @@ void Bitmap::clear_region(usize start, usize bits, bool value)
expect(initialized(), "Bitmap was never initialized");
expect((start + bits) <= size(), "Bitmap clear out of range");
if (!bits) return;
// Set individual bits while not on a byte boundary.
while ((start % 8) && bits--)
{