diff --git a/libluna/src/Bitmap.cpp b/libluna/src/Bitmap.cpp index 2cdc8037..b32285cc 100644 --- a/libluna/src/Bitmap.cpp +++ b/libluna/src/Bitmap.cpp @@ -37,8 +37,6 @@ Result Bitmap::deallocate() void* Bitmap::move(void* new_location, usize new_location_size_in_bytes) { - expect(initialized(), "Bitmap was never initialized"); - if (new_location_size_in_bytes > m_size_in_bytes) memcpy(new_location, m_location, m_size_in_bytes); else memcpy(new_location, m_location, new_location_size_in_bytes); @@ -53,7 +51,6 @@ void* Bitmap::move(void* new_location, usize new_location_size_in_bytes) void Bitmap::set(usize index, bool value) { - expect(initialized(), "Bitmap was never initialized"); expect(index < size(), "Bitmap access out of range"); const u64 byte_index = index / 8; const u8 bit_mask = (u8)(0b10000000 >> (index % 8)); @@ -63,7 +60,6 @@ void Bitmap::set(usize index, bool value) bool Bitmap::get(usize index) const { - expect(initialized(), "Bitmap was never initialized"); expect(index < size(), "Bitmap access out of range"); const usize byte_index = index / 8; const u8 bit_mask = (u8)(0b10000000 >> (index % 8)); @@ -72,13 +68,11 @@ bool Bitmap::get(usize index) const void Bitmap::clear(bool value) { - expect(initialized(), "Bitmap was never initialized"); memset(m_location, value_byte(value), m_size_in_bytes); } 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; @@ -108,8 +102,6 @@ void Bitmap::clear_region(usize start, usize bits, bool value) Option Bitmap::find(bool value, usize begin) const { - expect(initialized(), "Bitmap was never initialized"); - const usize size = this->size(); expect(begin < size, "Start index out of range"); @@ -223,7 +215,6 @@ bool Bitmap::match_region_impl(usize start, usize bits, bool value) bool Bitmap::match_region(usize start, usize bits, bool value) { - expect(initialized(), "Bitmap was never initialized"); expect((start + bits) <= size(), "Bitmap match out of range"); return match_region_impl(start, bits, value); @@ -231,7 +222,6 @@ bool Bitmap::match_region(usize start, usize bits, bool value) Result Bitmap::try_match_region(usize start, usize bits, bool value) { - expect(initialized(), "Bitmap was never initialized"); if ((start + bits) > size()) return err(EINVAL); return match_region_impl(start, bits, value);