1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/matrix.rb(Vector#each2, Vector#collect2): add type check for

Integer[Bug #2495].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
keiju 2010-03-29 11:27:03 +00:00
parent 33d1647252
commit cd492563f8
2 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Mon Mar 29 20:23:05 2010 Keiju Ishitsuka <keiju@ruby-lang.org>
* lib/matrix.rb(Vector#each2, Vector#collect2): add type check for
Integer[Bug #2495].
Mon Mar 29 19:45:09 2010 Tanaka Akira <akr@fsij.org>
* time.c: wide value condition changed.

View file

@ -1154,6 +1154,7 @@ class Vector
# Iterate over the elements of this vector and +v+ in conjunction.
#
def each2(v) # :yield: e1, e2
raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
Vector.Raise ErrDimensionMismatch if size != v.size
return to_enum(:each2, v) unless block_given?
size.times do |i|
@ -1167,6 +1168,7 @@ class Vector
# in conjunction.
#
def collect2(v) # :yield: e1, e2
raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
Vector.Raise ErrDimensionMismatch if size != v.size
return to_enum(:collect2, v) unless block_given?
size.times.collect do |i|