diff options
| author | Jun Hiroe <[email protected]> | 2014-05-05 12:40:15 +0900 |
|---|---|---|
| committer | Jun Hiroe <[email protected]> | 2014-05-05 12:40:15 +0900 |
| commit | c6551e03e074403bfbe328257c6c3540fe2e2565 (patch) | |
| tree | da454f77a19b143cb6e9d12b80b6a03f1fa1bb5c /src/string.c | |
| parent | 5921dd19c58862298cf8fc7df79b943152785d8d (diff) | |
| download | mruby-c6551e03e074403bfbe328257c6c3540fe2e2565.tar.gz mruby-c6551e03e074403bfbe328257c6c3540fe2e2565.zip | |
Refactor mrb_str_capitalize_bang()
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/string.c b/src/string.c index aa4f6bed5..2b232aa6a 100644 --- a/src/string.c +++ b/src/string.c @@ -914,7 +914,7 @@ static mrb_value mrb_str_capitalize_bang(mrb_state *mrb, mrb_value str) { char *p, *pend; - int modify = 0; + mrb_bool modify = FALSE; struct RString *s = mrb_str_ptr(str); mrb_str_modify(mrb, s); @@ -922,12 +922,12 @@ mrb_str_capitalize_bang(mrb_state *mrb, mrb_value str) p = STR_PTR(s); pend = STR_PTR(s) + STR_LEN(s); if (ISLOWER(*p)) { *p = TOUPPER(*p); - modify = 1; + modify = TRUE; } while (++p < pend) { if (ISUPPER(*p)) { *p = TOLOWER(*p); - modify = 1; + modify = TRUE; } } if (modify) return str; |
