Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
zevv committed Dec 16, 2024
1 parent 9d7742f commit 2736e29
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/zforth/zforth.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,7 @@ static void do_prim(zf_ctx *ctx, zf_prim op, const char *input)

case PRIM_LTZ:
/* Push true if less than zero, else false */
if(zf_pop(ctx) < 0) zf_push(ctx, ZF_TRUE);
else zf_push(ctx, ZF_FALSE);
zf_push(ctx, zf_pop(ctx) < 0 ? ZF_TRUE : ZF_FALSE);
break;

case PRIM_SEMICOL:
Expand Down Expand Up @@ -743,8 +742,7 @@ static void do_prim(zf_ctx *ctx, zf_prim op, const char *input)

case PRIM_EQUAL:
/* Push true if top two elements on stack are equal, else false */
if(zf_pop(ctx) == zf_pop(ctx)) zf_push(ctx, ZF_TRUE);
else zf_push(ctx, ZF_FALSE);
zf_push(ctx, zf_pop(ctx) == zf_pop(ctx) ? ZF_TRUE : ZF_FALSE);
break;

case PRIM_KEY:
Expand Down

0 comments on commit 2736e29

Please sign in to comment.