summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-27 09:29:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-27 09:29:26 +0000
commit018837b84f26adf1dd43ff0f41b211a41f5289e8 (patch)
tree4e552ee5749181b14dd80da1eb05d0dc9ed86645 /array.c
parent6ffdbac5edcdeb0a9c916735cab125674c5a693d (diff)
* node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.
[ruby-talk:117841] * ruby.h (FL_ABLE): nodes are not subject for flag operations. * io.c (ARGF_FORWARD): should have specified argv explicitly, since we no longer have frame->argv saved. [ruby-dev:24602] * string.c (RESIZE_CAPA): check string attribute before modifying capacity member of string structure. [ruby-dev:24594] * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in interpreter termination. [ruby-dev:24579] * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/array.c b/array.c
index a285f8a183..8c202a1fdc 100644
--- a/array.c
+++ b/array.c
@@ -816,9 +816,6 @@ rb_ary_aref(argc, argv, ary)
long beg, len;
if (argc == 2) {
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
beg = NUM2LONG(argv[0]);
len = NUM2LONG(argv[1]);
if (beg < 0) {
@@ -834,9 +831,6 @@ rb_ary_aref(argc, argv, ary)
if (FIXNUM_P(arg)) {
return rb_ary_entry(ary, FIX2LONG(arg));
}
- if (SYMBOL_P(arg)) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
/* check if idx is Range */
switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) {
case Qfalse:
@@ -1178,12 +1172,6 @@ rb_ary_aset(argc, argv, ary)
long offset, beg, len;
if (argc == 3) {
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
- if (SYMBOL_P(argv[1])) {
- rb_raise(rb_eTypeError, "Symbol as subarray length");
- }
rb_ary_update(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
return argv[2];
}
@@ -1194,9 +1182,6 @@ rb_ary_aset(argc, argv, ary)
offset = FIX2LONG(argv[0]);
goto fixnum;
}
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) {
/* check if idx is Range */
rb_ary_update(ary, beg, len, argv[1]);