summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-11-14 22:07:15 +0900
committerNobuyoshi Nakada <[email protected]>2023-11-15 17:52:40 +0900
commit7998dcdedc7f1d3cfaabfc3f68ca7635f0e5e1d1 (patch)
tree18bf31e0436da1bf1fc6cb66bb2f70ab80eedfd0
parentb69bbf588a3dd167d62dbb89f0cef25ebae4a7ea (diff)
Remove invariant condition
The `while` loop condition dereferences `cfp` and no `break` there, `cfp` cannot be NULL just after the loop.
-rw-r--r--vm.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/vm.c b/vm.c
index 789e0956be..80a6552cea 100644
--- a/vm.c
+++ b/vm.c
@@ -1750,12 +1750,7 @@ rb_vm_svar_lep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
}
}
- if (cfp) {
- return (VALUE *)VM_CF_LEP(cfp);
- }
- else {
- return NULL;
- }
+ return (VALUE *)VM_CF_LEP(cfp);
}
static VALUE