Permalink
Browse files

logic error?

  • Loading branch information...
1 parent 7972445 commit 095fdbc580b5f32df6ce66f60e5ac17b66e6561c @seamusabshere seamusabshere committed Jan 12, 2012
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/loose_tight_dictionary.rb
@@ -115,10 +115,18 @@ def find(needle, options = {})
[ candidates.dup, [] ]
end
- # special case: the needle didn't fit anywhere, but must_match_blocking is false, so we'll try it against everything
if joint.none?
- joint = disjoint
- disjoint = []
+ if must_match_blocking
+ if is_find_all
+ return []
+ else
+ return nil
+ end
+ else
+ # special case: the needle didn't fit anywhere, but must_match_blocking is false, so we'll try it against everything
+ joint = disjoint
+ disjoint = []
+ end
end
if gather_last_result

0 comments on commit 095fdbc

Please sign in to comment.