Skip to content

Commit

Permalink
Correctly excluding endpoints from stabbing queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansobo committed Jan 20, 2008
1 parent 9540aad commit 880c51a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/treetop/runtime/interval_skip_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def containing(n)
(max_height - 1).downto(0) do |cur_level|
while (next_node = cur_node.forward[cur_level]) && next_node.key <= n
cur_node = next_node
return containing if cur_node.key == n
if cur_node.key == n
return containing + (cur_node.markers - cur_node.endpoint_of)
end
end
containing.concat(cur_node.forward_markers[cur_level])
end
Expand Down
1 change: 0 additions & 1 deletion spec/runtime/interval_skip_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def confirm_containing_intervals(range, *markers)
end

it "returns only :a from 5 through 6" do
pending
(5..6).should contain_marker(:a)
end

Expand Down

0 comments on commit 880c51a

Please sign in to comment.