Use list LIFO access where appropriate.
* libmu_sieve/runtime.c (_mu_sv_instr_push) (_mu_sv_instr_pop): Use mu_list_push and mu_list_pop. * mail/alias.c (recursive_alias_expand): Likewise.
Showing
2 changed files
with
4 additions
and
5 deletions
... | @@ -131,7 +131,7 @@ _mu_sv_instr_push (mu_sieve_machine_t mach) | ... | @@ -131,7 +131,7 @@ _mu_sv_instr_push (mu_sieve_machine_t mach) |
131 | mu_sieve_error (mach, _("cannot create stack")); | 131 | mu_sieve_error (mach, _("cannot create stack")); |
132 | mu_sieve_abort (mach); | 132 | mu_sieve_abort (mach); |
133 | } | 133 | } |
134 | mu_list_prepend (mach->stack, (void*) mach->reg); | 134 | mu_list_push (mach->stack, (void*) mach->reg); |
135 | } | 135 | } |
136 | 136 | ||
137 | void | 137 | void |
... | @@ -149,8 +149,7 @@ _mu_sv_instr_pop (mu_sieve_machine_t mach) | ... | @@ -149,8 +149,7 @@ _mu_sv_instr_pop (mu_sieve_machine_t mach) |
149 | mu_sieve_error (mach, _("stack underflow")); | 149 | mu_sieve_error (mach, _("stack underflow")); |
150 | mu_sieve_abort (mach); | 150 | mu_sieve_abort (mach); |
151 | } | 151 | } |
152 | mu_list_get (mach->stack, 0, (void **)&mach->reg); | 152 | mu_list_pop (mach->stack, (void **)&mach->reg); |
153 | mu_list_remove (mach->stack, (void *)mach->reg); | ||
154 | } | 153 | } |
155 | 154 | ||
156 | void | 155 | void | ... | ... |
... | @@ -131,9 +131,9 @@ recursive_alias_expand (const char *name, mu_list_t exlist, mu_list_t origlist) | ... | @@ -131,9 +131,9 @@ recursive_alias_expand (const char *name, mu_list_t exlist, mu_list_t origlist) |
131 | mu_iterator_current (itr, (void **)&word); | 131 | mu_iterator_current (itr, (void **)&word); |
132 | if (mu_list_locate (origlist, word, NULL) == MU_ERR_NOENT) | 132 | if (mu_list_locate (origlist, word, NULL) == MU_ERR_NOENT) |
133 | { | 133 | { |
134 | mu_list_prepend (origlist, word); | 134 | mu_list_push (origlist, word); |
135 | recursive_alias_expand (word, exlist, origlist); | 135 | recursive_alias_expand (word, exlist, origlist); |
136 | mu_list_remove (origlist, word); | 136 | mu_list_pop (origlist, NULL); |
137 | } | 137 | } |
138 | } | 138 | } |
139 | mu_iterator_destroy (&itr); | 139 | mu_iterator_destroy (&itr); | ... | ... |
-
Please register or sign in to post a comment