summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-04-03 16:56:27 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-04-03 16:56:27 +0900
commit77331d127b6ab202e703bd7297ab6aabf4a314e9 (patch)
treee86c5ee7c9f4a5a867d63745607f525116b84d19 /mrbgems/mruby-string-ext/src
parentfbf4089d2f9480b5f5c9b8cdc312ad5e8417f62e (diff)
downloadmruby-77331d127b6ab202e703bd7297ab6aabf4a314e9.tar.gz
mruby-77331d127b6ab202e703bd7297ab6aabf4a314e9.zip
Unify `else` clause style
Diffstat (limited to 'mrbgems/mruby-string-ext/src')
-rw-r--r--mrbgems/mruby-string-ext/src/string.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mrbgems/mruby-string-ext/src/string.c b/mrbgems/mruby-string-ext/src/string.c
index 7e87b3db4..402dbf987 100644
--- a/mrbgems/mruby-string-ext/src/string.c
+++ b/mrbgems/mruby-string-ext/src/string.c
@@ -387,7 +387,8 @@ mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
if (e < b) {
e = p + l - 1;
result = mrb_str_new_lit(mrb, "");
- } else {
+ }
+ else {
// find leading letter of the ascii/number
b = e;
while (b > p) {
@@ -405,7 +406,8 @@ mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
if (*e == 0xff) {
mrb_str_cat_lit(mrb, result, "\x01");
(*e) = 0;
- } else
+ }
+ else
(*e)++;
break;
}
@@ -413,13 +415,16 @@ mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
if (*e == '9') {
if (e == b) prepend = "1";
*e = '0';
- } else if (*e == 'z') {
+ }
+ else if (*e == 'z') {
if (e == b) prepend = "a";
*e = 'a';
- } else if (*e == 'Z') {
+ }
+ else if (*e == 'Z') {
if (e == b) prepend = "A";
*e = 'A';
- } else {
+ }
+ else {
(*e)++;
break;
}