mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
rename mrb_str_buf_append to mrb_str_cat_str
The new name is better and less confusing, because: - `mrb_str_append` calls `mrb_str_to_str` and this function doesn't - `mrb_str_buf_append` _is_ `mrb_str_cat` for `mrb_value` strings
This commit is contained in:
+7
-8
@@ -1254,13 +1254,6 @@ mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
|
||||
return str2;
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_str_buf_append(mrb_state *mrb, mrb_value str, mrb_value str2)
|
||||
{
|
||||
mrb_str_cat(mrb, str, RSTRING_PTR(str2), RSTRING_LEN(str2));
|
||||
return str;
|
||||
}
|
||||
|
||||
mrb_int
|
||||
mrb_str_hash(mrb_state *mrb, mrb_value str)
|
||||
{
|
||||
@@ -2468,11 +2461,17 @@ mrb_str_cat_cstr(mrb_state *mrb, mrb_value str, const char *ptr)
|
||||
return mrb_str_cat(mrb, str, ptr, strlen(ptr));
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_str_cat_str(mrb_state *mrb, mrb_value str, mrb_value str2)
|
||||
{
|
||||
return mrb_str_cat(mrb, str, RSTRING_PTR(str2), RSTRING_LEN(str2));
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2)
|
||||
{
|
||||
str2 = mrb_str_to_str(mrb, str2);
|
||||
return mrb_str_buf_append(mrb, str, str2);
|
||||
return mrb_str_cat_str(mrb, str, str2);
|
||||
}
|
||||
|
||||
#define CHAR_ESC_LEN 13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */
|
||||
|
||||
Reference in New Issue
Block a user