no point checking if null and returning null

This commit is contained in:
Corwin Kuiper 2021-08-21 12:03:30 +01:00
parent 6523a3c6b8
commit 63d880f083

View file

@ -45,14 +45,7 @@ impl BlockAllocator {
unsafe fn new_block(&self, layout: Layout) -> *mut u8 {
let overall_layout = Block::either_layout(layout);
let block_ptr = self.inner_allocator.alloc(overall_layout);
if block_ptr.is_null() {
return core::ptr::null_mut();
}
block_ptr
self.inner_allocator.alloc(overall_layout)
}
}