diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-17 02:41:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-17 02:41:34 +0000 |
commit | df662292305f01cd08fcce28735722208f8c2ae3 (patch) | |
tree | 235622b3d5a85cf4efae922f134746cd7c948ca4 | |
parent | 6239e99d2d1758ffbfa99b1bcd36a29fded3a625 (diff) | |
download | ruby-df662292305f01cd08fcce28735722208f8c2ae3.tar.gz |
string.c: reduce duplicated code
* string.c (rb_str_cat, rb_str_cat2): reduce duplicated code, they
are same as rb_str_buf_cat and rb_str_buf_cat2 respectively now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | string.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -2066,17 +2066,13 @@ rb_str_buf_cat2(VALUE str, const char *ptr) VALUE rb_str_cat(VALUE str, const char *ptr, long len) { - if (len < 0) { - rb_raise(rb_eArgError, "negative string size (or size too big)"); - } - return rb_str_buf_cat(str, ptr, len); } VALUE rb_str_cat2(VALUE str, const char *ptr) { - return rb_str_cat(str, ptr, strlen(ptr)); + return rb_str_buf_cat2(str, ptr); } static VALUE |