Permalink
Browse files

fix up rarray subscript operation

  • Loading branch information...
Aarong93 committed Mar 1, 2012
1 parent ae4e6eb commit 70d34d796667340308ff7821bde2c1e08eb574fc
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/rsruby/rarray.rb
View
@@ -30,7 +30,6 @@ def subset(_keys,_dim)
new_order = _keys.map{|x|
all_keys.index(x)
}
new_order=new_order.compact
new_array = subset_helper(@array,new_order,0,_dim)
if @dimnames.is_a? Array
new_dimnames = @dimnames.dup
@@ -44,7 +43,7 @@ def subset(_keys,_dim)
def subset_helper(_array,_new_order,_current_depth,_target_depth)
if _current_depth == _target_depth
_new_order.map{|x|
_array.fetch(x)
x.nil? ? nil : _array.fetch(x)
}
else
_array.map{|x|

0 comments on commit 70d34d7

Please sign in to comment.