summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-18 16:44:49 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commita5ae9aebbc3d373d664747e5bfac5f47d3ac4102 (patch)
treea18a9250d1e6b7a6fc15f19cf178828fe662e964 /string.c
parentc7a40731549ce0dd6b52af512ebc0c588bce05f4 (diff)
trnext: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index c7be097b49..60ee2a5fa3 100644
--- a/string.c
+++ b/string.c
@@ -7119,8 +7119,8 @@ trnext(struct tr *t, rb_encoding *enc)
int n;
for (;;) {
+ nextpart:
if (!t->gen) {
-nextpart:
if (t->p == t->pend) return -1;
if (rb_enc_ascget(t->p, t->pend, &n, enc) == '\\' && t->p + n < t->pend) {
t->p += n;