Skip to content

Commit

Permalink
Move set size check into if condition
Browse files Browse the repository at this point in the history
Co-authored-by: pelijah <[email protected]>
  • Loading branch information
Rot127 and pelijah committed Apr 21, 2024
1 parent e5bbc87 commit 81867a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions librz/include/rz_util/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ RZ_API void advance_set_u_iter(SetU *s, SetUIter *it);
* So our condition checks if ti <= set->size.
*/
#define set_u_foreach(set, iter) \
if (set) \
for (advance_set_u_iter(set, &iter); iter.ti <= set->size && set_u_size(set) > 0; advance_set_u_iter(set, &iter))
if (set && set_u_size(set) > 0) \
for (advance_set_u_iter(set, &iter); iter.ti <= set->size; advance_set_u_iter(set, &iter))

#ifdef __cplusplus
}
Expand Down

0 comments on commit 81867a2

Please sign in to comment.