[NFC][sanitizer] Simplify GetThreadLocked

Now we can pass `invalid tid`.
This commit is contained in:
Vitaly Buka 2024-10-10 21:19:49 -07:00
parent df4c913425
commit 3cb4d20d5b

View File

@ -101,7 +101,7 @@ class SANITIZER_MUTEX ThreadRegistry {
// Should be guarded by ThreadRegistryLock.
ThreadContextBase *GetThreadLocked(u32 tid) {
return threads_.empty() ? nullptr : threads_[tid];
return tid < threads_.size() ? threads_[tid] : nullptr;
}
u32 NumThreadsLocked() const { return threads_.size(); }