Remove unnessesary nullptr checks

This commit is contained in:
Frederic Laing
2018-10-25 23:58:00 +02:00
parent e54c9e19f3
commit 49d8324d13
33 changed files with 93 additions and 95 deletions

View File

@@ -19,7 +19,7 @@ HandleTable::HandleTable() {
}
ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) {
DEBUG_ASSERT(obj != nullptr);
DEBUG_ASSERT(obj);
u16 slot = next_free_slot;
if (slot >= generations.size()) {
@@ -68,7 +68,7 @@ bool HandleTable::IsValid(Handle handle) const {
std::size_t slot = GetSlot(handle);
u16 generation = GetGeneration(handle);
return slot < MAX_COUNT && objects[slot] != nullptr && generations[slot] == generation;
return slot < MAX_COUNT && objects[slot] && generations[slot] == generation;
}
SharedPtr<Object> HandleTable::GetGeneric(Handle handle) const {