* string.c (str_to_id): a bug caused by premature optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
777aed2b15
commit
d064c0bf13
@ -1,3 +1,7 @@
|
|||||||
|
Sat Sep 2 23:59:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (str_to_id): a bug caused by premature optimization.
|
||||||
|
|
||||||
Sat Sep 2 23:53:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Sep 2 23:53:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* object.c (Init_Object): move symbol related code to string.c
|
* object.c (Init_Object): move symbol related code to string.c
|
||||||
|
2
string.c
2
string.c
@ -4538,8 +4538,6 @@ str_to_id(VALUE str)
|
|||||||
if (!RSTRING_PTR(str) || RSTRING_LEN(str) == 0) {
|
if (!RSTRING_PTR(str) || RSTRING_LEN(str) == 0) {
|
||||||
rb_raise(rb_eArgError, "empty symbol string");
|
rb_raise(rb_eArgError, "empty symbol string");
|
||||||
}
|
}
|
||||||
if (RBASIC(str)->klass == rb_cSymbol)
|
|
||||||
return str;
|
|
||||||
return rb_intern2(RSTRING_PTR(str), RSTRING_LEN(str));
|
return rb_intern2(RSTRING_PTR(str), RSTRING_LEN(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user