diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-24 10:43:56 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-24 10:43:56 +0000 |
commit | 9bfc01ea1704933e10c2662f8ef9e1247ec5c1bb (patch) | |
tree | e2ceccd2798e06bf2a6d29f7f2d23b197b88183c /parse.y | |
parent | 1b6572295ade3f9a2a461004e72834030d613fae (diff) | |
download | ruby-9bfc01ea1704933e10c2662f8ef9e1247ec5c1bb.tar.gz |
* parse.y (debug_lines): Always prepare a new array for each
file's SCRIPT_LINES__ storage, instead of appending source lines
every time a file is re-loaded; submitted by Rocky Bernstein in
#18517.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -4680,11 +4680,8 @@ debug_lines(const char *f) VALUE hash = rb_const_get_at(rb_cObject, rb_intern("SCRIPT_LINES__")); if (TYPE(hash) == T_HASH) { VALUE fname = rb_str_new2(f); - VALUE lines = rb_hash_lookup(hash, fname); - if (NIL_P(lines)) { - lines = rb_ary_new(); - rb_hash_aset(hash, fname, lines); - } + VALUE lines = rb_ary_new(); + rb_hash_aset(hash, fname, lines); return lines; } } |