Move iter->exists() check to first

This commit is contained in:
Asdow
2026-06-12 15:52:24 +03:00
parent 9b654ff3f1
commit 6a8a22aba2
10 changed files with 38 additions and 38 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ INT32 GetSpreadPattern( OBJECTTYPE * pObj )
//If there are attachments, check them. Stop on the first one with something defined.
//Dear God, I hate C++ iterators. What a fugly mess. //WarmSteel - I made it even messier ;3
for (attachmentList::iterator iter = pObj[0][0]->attachments.begin(); iter != pObj[0][0]->attachments.end(); ++iter){
if( (n=Item[ iter->usItem ].spreadPattern) && iter->exists()){
if( iter->exists() && (n=Item[ iter->usItem ].spreadPattern) ){
//An attachment has it, and it trumps everything, so return it's value.
return n;}
}