From a59c599209a11d4ab0dc0d7626ab3d5ca43a78c2 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 11 Dec 2001 03:48:08 +0000 Subject: * string.c (rb_str_match_m): should convert an argument into regexp if it's a string. * array.c (rb_ary_select): Array#select(n,m,...) now works like Array#indexes(n,m,..). [new, experimental] * hash.c (rb_hash_select): ditto. * hash.c (env_select): ditto. * re.c (match_select): ditto. * struct.c (rb_struct_select): ditto. * gc.c (STR_ASSOC): use FL_USER3 instead of FL_USER2. * parse.y (str_extend): make up pushback call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 1f8f2fb7ff..7c010a3789 100644 --- a/variable.c +++ b/variable.c @@ -143,9 +143,8 @@ classname(klass) ID classpath = rb_intern("__classpath__"); if (!klass) klass = rb_cObject; - if (!ROBJECT(klass)->iv_tbl) - ROBJECT(klass)->iv_tbl = st_init_numtable(); - else if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) { + if (ROBJECT(klass)->iv_tbl && + !st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) { ID classid = rb_intern("__classid__"); if (st_lookup(ROBJECT(klass)->iv_tbl, classid, &path)) { -- cgit v1.2.3