[+] Added AuExists semantic
This commit is contained in:
parent
ea83fcef20
commit
a6d1c04ba0
@ -249,6 +249,12 @@ static inline bool AuTryFind(Map &map, const Key &key)
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Range, class Key>
|
||||
static inline bool AuExists(Range &a, const Key &item)
|
||||
{
|
||||
return std::find(a.begin(), a.end(), item) != a.end();
|
||||
}
|
||||
|
||||
template<typename Map, class Key>
|
||||
static inline bool AuTryFind(Map *map, const Key &key)
|
||||
{
|
||||
|
@ -353,7 +353,7 @@ namespace Aurora::Async
|
||||
state->loopSources.clear();
|
||||
state->loopSources.reserve(curLoopReq.size());
|
||||
|
||||
if (std::find(nextLoopSources.begin(), nextLoopSources.end(), group->eventLs) != nextLoopSources.end())
|
||||
if (AuExists(nextLoopSources, group->eventLs))
|
||||
{
|
||||
PollInternal(false);
|
||||
}
|
||||
@ -363,7 +363,7 @@ namespace Aurora::Async
|
||||
bool remove {};
|
||||
bool removeType {};
|
||||
|
||||
if (std::find(nextLoopSources.begin(), nextLoopSources.end(), request.loopSource) != nextLoopSources.end())
|
||||
if (AuExists(nextLoopSources, request.loopSource))
|
||||
{
|
||||
remove = true;
|
||||
removeType = true;
|
||||
|
Loading…
Reference in New Issue
Block a user