mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 06:46:43 +00:00
[NFC][sanitizer] Simplify GetThreadLocked
Now we can pass `invalid tid`.
This commit is contained in:
parent
df4c913425
commit
3cb4d20d5b
@ -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(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user