Commit 5e5ca8de authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2275 from suzukaze/refactor-string.c-2

Refactor string.c Fix #2267
parents a1a5eae9 932efe53
...@@ -277,10 +277,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len) ...@@ -277,10 +277,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len)
mrb_value mrb_value
mrb_str_new(mrb_state *mrb, const char *p, size_t len) mrb_str_new(mrb_state *mrb, const char *p, size_t len)
{ {
struct RString *s; return mrb_obj_value(str_new(mrb, p, len));
s = str_new(mrb, p, len);
return mrb_obj_value(s);
} }
/* /*
...@@ -666,12 +663,10 @@ static mrb_value ...@@ -666,12 +663,10 @@ static mrb_value
mrb_str_equal_m(mrb_state *mrb, mrb_value str1) mrb_str_equal_m(mrb_state *mrb, mrb_value str1)
{ {
mrb_value str2; mrb_value str2;
mrb_bool equal_p;
mrb_get_args(mrb, "o", &str2); mrb_get_args(mrb, "o", &str2);
equal_p = mrb_str_equal(mrb, str1, str2);
return mrb_bool_value(equal_p); return mrb_bool_value(mrb_str_equal(mrb, str1, str2));
} }
/* ---------------------------------- */ /* ---------------------------------- */
mrb_value mrb_value
...@@ -1489,11 +1484,7 @@ mrb_str_init(mrb_state *mrb, mrb_value self) ...@@ -1489,11 +1484,7 @@ mrb_str_init(mrb_state *mrb, mrb_value self)
mrb_value mrb_value
mrb_str_intern(mrb_state *mrb, mrb_value self) mrb_str_intern(mrb_state *mrb, mrb_value self)
{ {
mrb_sym id; return mrb_symbol_value(mrb_intern_str(mrb, self));
id = mrb_intern_str(mrb, self);
return mrb_symbol_value(id);
} }
/* ---------------------------------- */ /* ---------------------------------- */
mrb_value mrb_value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment