Bitmap: short circuit on 0-byte clears
This commit is contained in:
parent
4fdd1d57f5
commit
d3458f2f0f
@ -62,6 +62,8 @@ void Bitmap::clear_region(usize start, usize bits, bool value)
|
|||||||
expect(initialized(), "Bitmap was never initialized");
|
expect(initialized(), "Bitmap was never initialized");
|
||||||
expect((start + bits) <= size(), "Bitmap clear out of range");
|
expect((start + bits) <= size(), "Bitmap clear out of range");
|
||||||
|
|
||||||
|
if (!bits) return;
|
||||||
|
|
||||||
// Set individual bits while not on a byte boundary.
|
// Set individual bits while not on a byte boundary.
|
||||||
while ((start % 8) && bits--)
|
while ((start % 8) && bits--)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user