Skip to content

Commit

Permalink
fixed some first specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Andreev committed Apr 28, 2008
1 parent 3825b1e commit 060a1dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/strokedb/data_structures/simple_skiplist.rb
Expand Up @@ -42,7 +42,7 @@ def marshal_load(dumped)
# Tests whether skiplist is empty.
#
def empty?
!node_next(@head, 0)
node_next(@head, 0) == @tail
end

# Complicated search algorithm
Expand Down Expand Up @@ -209,8 +209,10 @@ def find_nearest_node(key) #:nodoc:
# }
# end
end
declare_optimized_methods(:C) do
end

declare_optimized_methods(:C, :find_nearest_node, :find_with_update) do
declare_optimized_methods(:X, :find_nearest_node, :find_with_update) do
require 'rubygems'
require 'inline'
inline(:C) do |builder|
Expand Down Expand Up @@ -286,7 +288,8 @@ def find(key)

def each_node #:nodoc:
x = node_next(anchor, 0)
while x
tail = @tail
while x != tail
yield(x)
x = node_next(x, 0)
end
Expand Down

0 comments on commit 060a1dc

Please sign in to comment.