summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/handle_table.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp
index 84a9ca7fc..bdfaa977f 100644
--- a/src/core/hle/kernel/handle_table.cpp
+++ b/src/core/hle/kernel/handle_table.cpp
@@ -79,10 +79,11 @@ ResultVal<Handle> HandleTable::Duplicate(Handle handle) {
79} 79}
80 80
81ResultCode HandleTable::Close(Handle handle) { 81ResultCode HandleTable::Close(Handle handle) {
82 if (!IsValid(handle)) 82 if (!IsValid(handle)) {
83 return ERR_INVALID_HANDLE; 83 return ERR_INVALID_HANDLE;
84 }
84 85
85 u16 slot = GetSlot(handle); 86 const u16 slot = GetSlot(handle);
86 87
87 objects[slot] = nullptr; 88 objects[slot] = nullptr;
88 89
@@ -92,8 +93,8 @@ ResultCode HandleTable::Close(Handle handle) {
92} 93}
93 94
94bool HandleTable::IsValid(Handle handle) const { 95bool HandleTable::IsValid(Handle handle) const {
95 std::size_t slot = GetSlot(handle); 96 const std::size_t slot = GetSlot(handle);
96 u16 generation = GetGeneration(handle); 97 const u16 generation = GetGeneration(handle);
97 98
98 return slot < table_size && objects[slot] != nullptr && generations[slot] == generation; 99 return slot < table_size && objects[slot] != nullptr && generations[slot] == generation;
99} 100}