3
0
Fork 0
forked from suyu/suyu

kernel/thread: Make parameter of GetWaitObjectIndex() const qualified

The pointed to member is never actually modified, so it can be made
const.
This commit is contained in:
Lioncash 2019-04-01 17:48:31 -04:00
parent 62860dc0b0
commit 26d0381161
2 changed files with 3 additions and 3 deletions

View file

@ -229,9 +229,9 @@ void Thread::SetWaitSynchronizationOutput(s32 output) {
context.cpu_registers[1] = output; context.cpu_registers[1] = output;
} }
s32 Thread::GetWaitObjectIndex(WaitObject* object) const { s32 Thread::GetWaitObjectIndex(const WaitObject* object) const {
ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything");
auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); const auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object);
return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1);
} }

View file

@ -205,7 +205,7 @@ public:
* object in the list. * object in the list.
* @param object Object to query the index of. * @param object Object to query the index of.
*/ */
s32 GetWaitObjectIndex(WaitObject* object) const; s32 GetWaitObjectIndex(const WaitObject* object) const;
/** /**
* Stops a thread, invalidating it from further use * Stops a thread, invalidating it from further use