summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-24 08:29:03 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-24 08:29:03 (GMT)
commitd92b0dc58aa161801a5e5d4a484e67a9dd61bb65 (patch)
tree49c08d39782c0199163034db490aa9f8b259732f /vm_method.c
parent43b5e3d7cddad91cb9fd2f583c926519ea39c90c (diff)
vm_method.c: remove redundant check
* vm_method.c (rb_attr): remove redundant check. attribute names given in ruby level should be checked before calling this function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/vm_method.c b/vm_method.c
index d559cd8..0cbebea 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -912,8 +912,6 @@ rb_method_boundp(VALUE klass, ID id, int ex)
return 0;
}
-extern ID rb_check_attr_id(ID id);
-
static int
rb_scope_visibility_test(rb_method_visibility_t visi)
{
@@ -953,8 +951,7 @@ rb_scope_module_func_set(void)
void
rb_attr(VALUE klass, ID id, int read, int write, int ex)
{
- VALUE attriv;
- VALUE aname;
+ ID attriv;
rb_method_visibility_t visi;
if (!ex) {
@@ -975,11 +972,7 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
}
}
- aname = rb_id2str(rb_check_attr_id(id));
- if (NIL_P(aname)) {
- rb_raise(rb_eArgError, "argument needs to be symbol or string");
- }
- attriv = (VALUE)rb_intern_str(rb_sprintf("@%"PRIsVALUE, aname));
+ attriv = rb_intern_str(rb_sprintf("@%"PRIsVALUE, rb_id2str(id)));
if (read) {
rb_add_method(klass, id, VM_METHOD_TYPE_IVAR, (void *)attriv, visi);
}