mirror of https://github.com/PrimeDecomp/prime.git
Use rstl::find
This commit is contained in:
parent
7f414d1d5e
commit
6c4971ec76
|
@ -81,13 +81,6 @@ public:
|
|||
--x0_count;
|
||||
}
|
||||
}
|
||||
|
||||
iterator find(const T& value) {
|
||||
rstl::reserved_vector< TUniqueId, 8 >::iterator it = begin();
|
||||
for (; it != end() && *it != value; ++it) {
|
||||
}
|
||||
return it;
|
||||
}
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include "MetroidPrime/Enemies/CMetroidPrimeRelay.hpp"
|
||||
#include "MetroidPrime/Player/CPlayer.hpp"
|
||||
|
||||
#include "rstl/algorithm.hpp"
|
||||
|
||||
CScriptPlayerHint::CScriptPlayerHint(TUniqueId uid, const rstl::string& name,
|
||||
const CEntityInfo& info, const CTransform4f& xf, bool active,
|
||||
int priority, int overrideFlags)
|
||||
|
@ -18,7 +20,7 @@ CScriptPlayerHint::CScriptPlayerHint(TUniqueId uid, const rstl::string& name,
|
|||
void CScriptPlayerHint::ClearObjectList() { xe8_objectList.clear(); }
|
||||
|
||||
void CScriptPlayerHint::AddToObjectList(TUniqueId uid) {
|
||||
rstl::reserved_vector< TUniqueId, 8 >::iterator it = xe8_objectList.find(uid);
|
||||
rstl::reserved_vector< TUniqueId, 8 >::iterator it = rstl::find(xe8_objectList.begin(), xe8_objectList.end(), uid);
|
||||
if (it != xe8_objectList.end()) {
|
||||
return;
|
||||
}
|
||||
|
@ -30,7 +32,7 @@ void CScriptPlayerHint::RemoveFromObjectList(TUniqueId uid, CStateManager& mgr)
|
|||
return;
|
||||
}
|
||||
|
||||
rstl::reserved_vector< TUniqueId, 8 >::iterator it = xe8_objectList.find(uid);
|
||||
rstl::reserved_vector< TUniqueId, 8 >::iterator it = rstl::find(xe8_objectList.begin(), xe8_objectList.end(), uid);
|
||||
|
||||
if (it == xe8_objectList.end()) {
|
||||
xe8_objectList.erase(xe8_objectList.begin());
|
||||
|
|
Loading…
Reference in New Issue