Skip to content

Commit

Permalink
* detect_index_no refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fl00r committed May 23, 2012
1 parent dcebf6f commit 977dbd7
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/tarantool/record.rb
Expand Up @@ -77,20 +77,14 @@ def first
end

def detect_index_no(keys)
index_no = nil
record.indexes.each_with_index do |v, i|
record.indexes.each.with_index do |v, i|
keys_inst = keys.dup
v.each do |index_part|
unless keys_inst.delete(index_part)
break
end
if keys_inst.size == 0
index_no = i
end
break unless keys_inst.delete(index_part)
return i if keys_inst.empty?
end
break if index_no
end
index_no
nil
end

def to_records(tuples)
Expand Down

0 comments on commit 977dbd7

Please sign in to comment.