ruby-changes:56504
From: Yusuke <ko1@a...>
Date: Sun, 14 Jul 2019 23:21:00 +0900 (JST)
Subject: [ruby-changes:56504] Yusuke Endoh: 43c337dfc1 (master): string.c (str_succ): refactoring
https://git.ruby-lang.org/ruby.git/commit/?id=43c337dfc1 From 43c337dfc18676e95f9fb9b1d6bf3beb3ec6b306 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Sun, 14 Jul 2019 23:04:48 +0900 Subject: string.c (str_succ): refactoring Use more communicative variable name diff --git a/string.c b/string.c index aadc725..fcaf280 100644 --- a/string.c +++ b/string.c @@ -4125,7 +4125,7 @@ str_succ(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L4125 { rb_encoding *enc; char *sbeg, *s, *e, *last_alnum = 0; - int c = -1; + int found_alnum = 0; long l, slen; char carry[ONIGENC_CODE_TO_MBC_MAXLEN] = "\1"; long carry_pos = 0, carry_len = 1; @@ -4158,11 +4158,11 @@ str_succ(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L4158 last_alnum = s; break; } - c = 1; + found_alnum = 1; carry_pos = s - sbeg; carry_len = l; } - if (c == -1) { /* str contains no alnum */ + if (!found_alnum) { /* str contains no alnum */ s = e; while ((s = rb_enc_prev_char(sbeg, s, e, enc)) != 0) { enum neighbor_char neighbor; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/