aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-01-14 20:55:10 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-01-29 11:08:46 +0100
commitada36d9024b4ceda974f32a78b5fe39b64f59319 (patch)
tree68738beb3bce8a9588d7af675632165952dcb351
parentd39affeac223a7e2891b509395e7b19c931b5018 (diff)
downloadotp-ada36d9024b4ceda974f32a78b5fe39b64f59319.tar.gz
otp-ada36d9024b4ceda974f32a78b5fe39b64f59319.tar.bz2
otp-ada36d9024b4ceda974f32a78b5fe39b64f59319.zip
erts: Simplify some map iterator code
-rw-r--r--erts/emulator/beam/erl_nif.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 94c2512650..c6f7c8adb5 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1743,20 +1743,14 @@ int enif_map_iterator_is_tail(ErlNifEnv *env, ErlNifMapIterator *iter)
{
ASSERT(iter && is_map(iter->map));
ASSERT(iter->idx >= 0 && (iter->idx <= map_get_size(map_val(iter->map)) + 1));
- if (iter->t_limit == 1 || iter->idx == iter->t_limit) {
- return 1;
- }
- return 0;
+ return (iter->t_limit == 1 || iter->idx == iter->t_limit);
}
int enif_map_iterator_is_head(ErlNifEnv *env, ErlNifMapIterator *iter)
{
ASSERT(iter && is_map(iter->map));
ASSERT(iter->idx >= 0 && (iter->idx <= map_get_size(map_val(iter->map)) + 1));
- if (iter->t_limit == 1 || iter->idx == 0) {
- return 1;
- }
- return 0;
+ return (iter->t_limit == 1 || iter->idx == 0);
}