aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-06 22:11:29 -0700
committerChris Robinson <[email protected]>2014-07-06 22:11:29 -0700
commitc5af088b5ff1f7b5c51dbdcb7327d3f22c1de5df (patch)
treecad6bb33410b40117199f089cf114cb8b1112b58 /Alc
parentf4f1c1eeedf175eea5ddafbb73d015b210674596 (diff)
Access the result macro parameter only once
Diffstat (limited to 'Alc')
-rw-r--r--Alc/vector.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Alc/vector.h b/Alc/vector.h
index cc0c84fb..b98e87f4 100644
--- a/Alc/vector.h
+++ b/Alc/vector.h
@@ -75,13 +75,14 @@ ALboolean vector_insert(void *ptr, size_t base_size, size_t obj_size, void *ins_
} while(0)
#define VECTOR_FIND_IF(_i, _t, _x, _f) do { \
+ _t *_iter = VECTOR_ITER_BEGIN((_x)); \
_t *_end = VECTOR_ITER_END((_x)); \
- (_i) = VECTOR_ITER_BEGIN((_x)); \
- for(;(_i) != _end;++(_i)) \
+ for(;_iter != _end;++_iter) \
{ \
- if(_f(_i)) \
+ if(_f(_iter)) \
break; \
} \
+ (_i) = _iter; \
} while(0)
#endif /* AL_VECTOR_H */