Use auto to reduce vector iteration redundancy

develop
Chris Dombroski 2015-01-28 08:50:56 -05:00
parent 5f9fe871b3
commit 10ec5f1330
1 changed files with 4 additions and 4 deletions

@ -718,11 +718,11 @@ bool isGay(df::unit* unit)
bool isGelded(df::unit* unit)
{
vector<df::unit_wound*> wounds = unit->body.wounds;
for(vector<df::unit_wound*>::iterator wound = wounds.begin(); wound != wounds.end(); ++wound)
auto wounds = unit->body.wounds;
for(auto wound = wounds.begin(); wound != wounds.end(); ++wound)
{
vector<df::unit_wound::T_parts*> parts = (*wound)->parts;
for (vector<df::unit_wound::T_parts*>::iterator part = parts.begin(); part != parts.end(); ++part)
auto parts = (*wound)->parts;
for (auto part = parts.begin(); part != parts.end(); ++part)
{
if ((*part)->flags2.bits.gelded)
return true;