diff options
| author | cremno <[email protected]> | 2014-04-21 21:24:00 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2014-04-21 21:28:06 +0200 |
| commit | bc23a5e9e555f7a0b606856c417b9910ed92af68 (patch) | |
| tree | e6e5d9a9f13f8a427090a11b3da251a3644cb14a /src/string.c | |
| parent | db6e8682654ec71d7aca7b3d03119e9440a7f5b1 (diff) | |
| download | mruby-bc23a5e9e555f7a0b606856c417b9910ed92af68.tar.gz mruby-bc23a5e9e555f7a0b606856c417b9910ed92af68.zip | |
remove `mrb_str_buf_cat`
It does the same as `mrb_str_cat`.
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/string.c b/src/string.c index f78564fb8..1e3c7db3a 100644 --- a/src/string.c +++ b/src/string.c @@ -278,14 +278,6 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len) } mrb_value -mrb_str_buf_cat(mrb_state *mrb, mrb_value str, const char *ptr, size_t len) -{ - if (len == 0) return str; - str_buf_cat(mrb, mrb_str_ptr(str), ptr, len); - return str; -} - -mrb_value mrb_str_new(mrb_state *mrb, const char *p, size_t len) { struct RString *s; @@ -2518,12 +2510,12 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str) c = *p; if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p, pend))) { buf[0] = '\\'; buf[1] = c; - mrb_str_buf_cat(mrb, result, buf, 2); + mrb_str_cat(mrb, result, buf, 2); continue; } if (ISPRINT(c)) { buf[0] = c; - mrb_str_buf_cat(mrb, result, buf, 1); + mrb_str_cat(mrb, result, buf, 1); continue; } switch (c) { @@ -2540,7 +2532,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str) if (cc) { buf[0] = '\\'; buf[1] = (char)cc; - mrb_str_buf_cat(mrb, result, buf, 2); + mrb_str_cat(mrb, result, buf, 2); continue; } else { @@ -2548,7 +2540,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str) buf[3] = '0' + c % 8; c /= 8; buf[2] = '0' + c % 8; c /= 8; buf[1] = '0' + c % 8; - mrb_str_buf_cat(mrb, result, buf, 4); + mrb_str_cat(mrb, result, buf, 4); continue; } } |
