diff options
| author | Nakidai <nakidai@disroot.org> | 2025-07-18 04:11:27 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2025-07-18 04:11:27 +0300 |
| commit | c77be86fbad31705ad4f20ff37da6d00ec66d821 (patch) | |
| tree | 3493664ef71606fe888994e3bdfc12e794d853c6 /executor.c | |
| parent | a8f56cef862ca00b31661bbe1fbb1d3690163aaf (diff) | |
| download | 3cl-c77be86fbad31705ad4f20ff37da6d00ec66d821.tar.gz 3cl-c77be86fbad31705ad4f20ff37da6d00ec66d821.zip | |
Reading the code again I noticed using goto here for no good reason. Well, not a critical issue anyway this should improve readability
Diffstat (limited to 'executor.c')
| -rw-r--r-- | executor.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/executor.c b/executor.c index a528c4c..cb5e865 100644 --- a/executor.c +++ b/executor.c @@ -99,7 +99,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: return cccl_Executor_ERROR; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_PUSHZERO: @@ -252,7 +252,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: return cccl_Executor_ERROR; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_INFINITE: @@ -275,7 +275,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: break; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_REPEAT: @@ -294,7 +294,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: break; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_CONDITIONAL: @@ -322,6 +322,5 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab } break; } -end: - return 0; + return cccl_Executor_OK; } |