diff options
| author | cremno <[email protected]> | 2015-07-16 03:56:31 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2015-07-16 03:56:31 +0200 |
| commit | 938ed044f4e053c1832be3868230d80ccba190e8 (patch) | |
| tree | 78019791c7bbcdaadca128a7a1692ac7422996af /src/range.c | |
| parent | 207577f0af72874d9d643f2c46b881a9159d42d7 (diff) | |
| download | mruby-938ed044f4e053c1832be3868230d80ccba190e8.tar.gz mruby-938ed044f4e053c1832be3868230d80ccba190e8.zip | |
use mrb_str_cat_str() instead of mrb_str_append()
If the argument is always a string, then mrb_str_cat_str() can be
directly called instead of indirectly by mrb_str_append().
mrb_any_to_s(), mrb_obj_as_string(), mrb_inspect() always return a
string.
Diffstat (limited to 'src/range.c')
| -rw-r--r-- | src/range.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/range.c b/src/range.c index b427dc1b7..b58b6a1c8 100644 --- a/src/range.c +++ b/src/range.c @@ -290,7 +290,7 @@ range_to_s(mrb_state *mrb, mrb_value range) str2 = mrb_obj_as_string(mrb, r->edges->end); str = mrb_str_dup(mrb, str); mrb_str_cat(mrb, str, "...", r->excl ? 3 : 2); - mrb_str_append(mrb, str, str2); + mrb_str_cat_str(mrb, str, str2); return str; } @@ -315,7 +315,7 @@ range_inspect(mrb_state *mrb, mrb_value range) str2 = mrb_inspect(mrb, r->edges->end); str = mrb_str_dup(mrb, str); mrb_str_cat(mrb, str, "...", r->excl ? 3 : 2); - mrb_str_append(mrb, str, str2); + mrb_str_cat_str(mrb, str, str2); return str; } |
