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
This commit is contained in:
parent
6239e99d2d
commit
df66229230
6
string.c
6
string.c
@ -2066,17 +2066,13 @@ rb_str_buf_cat2(VALUE str, const char *ptr)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_str_cat(VALUE str, const char *ptr, long len)
|
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);
|
return rb_str_buf_cat(str, ptr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_str_cat2(VALUE str, const char *ptr)
|
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
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user