Made IsTargetLocal() a lot faster by using BPrivate::current_team() which caches the team ID.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21104 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2005, Haiku.
|
* Copyright 2001-2007, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -161,9 +161,7 @@ BMessenger::~BMessenger()
|
|||||||
bool
|
bool
|
||||||
BMessenger::IsTargetLocal() const
|
BMessenger::IsTargetLocal() const
|
||||||
{
|
{
|
||||||
thread_info info;
|
return BPrivate::current_team() == fTeam;
|
||||||
return get_thread_info(find_thread(NULL), &info) == B_OK
|
|
||||||
&& fTeam == info.team;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user