CElitePirate: Collapse indexing into back() calls where applicable

Same behavior, but more compact.
This commit is contained in:
Lioncash 2020-04-02 00:24:22 -04:00
parent 6e179bfa87
commit 60000c163b
1 changed files with 2 additions and 2 deletions

View File

@ -1190,7 +1190,7 @@ bool CElitePirate::IsClosestEnergyAttractor(const CStateManager& mgr,
zeus::CVector3f CElitePirate::SUnknownStruct::GetValue(const zeus::CVector3f& v1, const zeus::CVector3f& v2) { zeus::CVector3f CElitePirate::SUnknownStruct::GetValue(const zeus::CVector3f& v1, const zeus::CVector3f& v2) {
while (!x4_.empty()) { while (!x4_.empty()) {
const zeus::CVector3f v = x4_[x4_.size() - 1] - v1; const zeus::CVector3f v = x4_.back() - v1;
if (v.dot(v2) > 0.f && v.isMagnitudeSafe()) { if (v.dot(v2) > 0.f && v.isMagnitudeSafe()) {
return v.normalized(); return v.normalized();
} }
@ -1207,7 +1207,7 @@ void CElitePirate::SUnknownStruct::AddValue(const zeus::CVector3f& vec) {
x4_.emplace_back(vec); x4_.emplace_back(vec);
return; return;
} }
if (x4_[x4_.size() - 1].magSquared() > x0_) { if (x4_.back().magSquared() > x0_) {
x4_.emplace_back(vec); x4_.emplace_back(vec);
} }
} }