summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-16 08:06:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-16 08:06:39 +0000
commitca65a56bd824b356b5bb318d262936e673f87cf0 (patch)
tree80d28c3dba6e3c5f9f392fd3c1e7eb68d45a3383 /string.c
parent3a206c91247dc85ab2f9d08875757347812214de (diff)
string.c: no copy of interned strings
* string.c (sym_succ, sym_cmp, sym_casecmp, sym_match, sym_aref): not need to make copy of interned strings, use directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/string.c b/string.c
index a8fd16ece3..80190548be 100644
--- a/string.c
+++ b/string.c
@@ -8515,7 +8515,7 @@ sym_to_proc(VALUE sym)
static VALUE
sym_succ(VALUE sym)
{
- return rb_str_dynamic_intern(rb_str_succ(rb_sym_to_s(sym)));
+ return rb_str_dynamic_intern(rb_str_succ(rb_sym2str(sym)));
}
/*
@@ -8538,7 +8538,7 @@ sym_cmp(VALUE sym, VALUE other)
if (!SYMBOL_P(other)) {
return Qnil;
}
- return rb_str_cmp_m(rb_sym_to_s(sym), rb_sym_to_s(other));
+ return rb_str_cmp_m(rb_sym2str(sym), rb_sym2str(other));
}
/*
@@ -8555,7 +8555,7 @@ sym_casecmp(VALUE sym, VALUE other)
if (!SYMBOL_P(other)) {
return Qnil;
}
- return rb_str_casecmp(rb_sym_to_s(sym), rb_sym_to_s(other));
+ return rb_str_casecmp(rb_sym2str(sym), rb_sym2str(other));
}
/*
@@ -8569,7 +8569,7 @@ sym_casecmp(VALUE sym, VALUE other)
static VALUE
sym_match(VALUE sym, VALUE other)
{
- return rb_str_match(rb_sym_to_s(sym), other);
+ return rb_str_match(rb_sym2str(sym), other);
}
/*
@@ -8585,7 +8585,7 @@ sym_match(VALUE sym, VALUE other)
static VALUE
sym_aref(int argc, VALUE *argv, VALUE sym)
{
- return rb_str_aref_m(argc, argv, rb_sym_to_s(sym));
+ return rb_str_aref_m(argc, argv, rb_sym2str(sym));
}
/*