Skip to content

Commit

Permalink
view_storage.rb: renamed @skiplist -> @list
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Andreev committed Apr 27, 2008
1 parent c115223 commit 3c86606
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/strokedb/views/view_storage.rb
Expand Up @@ -5,7 +5,7 @@ class ViewStorage
def initialize(options = {})
# TODO: find out whether the view indexfile exists and read
# its options
@skiplist = SimpleSkiplist.new
@list = SimpleSkiplist.new
end

def set_options(options)
Expand All @@ -20,20 +20,20 @@ def set_options(options)
#
#
def oleganza_find(start_key, end_key, limit, offset, reverse, with_keys)
@skiplist.search(start_key, end_key, limit, offset, reverse, with_keys)
@list.search(start_key, end_key, limit, offset, reverse, with_keys)
end

#
#
def find(start_key, end_key, key, limit, offset, reverse, with_keys)
start_key = end_key = key if start_key.nil? && end_key.nil?
# Please note that below algorithm will most probably be eventually replaced by a new skiplist Oleg Andreev works on currently
start_key = @skiplist.first_key unless start_key
start_key = @list.first_key unless start_key
current_key = start_key
offset ||= 0

items = []
item = @skiplist.find_nearest_node(current_key)
item = @list.find_nearest_node(current_key)

offset.times do
item = item[0][0] # next node
Expand Down

0 comments on commit 3c86606

Please sign in to comment.