sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 36379b8ab24cfcf505631aff155dd758ae229458
parent 7d9f78c67c9d6552398ea95f74976e62ef3f4a65
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sat, 30 Dec 2006 15:34:23 +0000

fixed num_results_for


git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@126 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M lib/sup/index.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup/index.rb b/lib/sup/index.rb
@@ -125,7 +125,9 @@ class Index
   end
 
   def num_results_for opts={}
-    with(build_query(opts)) { |query| with(@index.search(query).total_hits) { |x| Redwood::log "num_results_for: have #{x} for query #{query}" } }
+    return 0 if @index.size == 0 # otherwise ferret barfs ###TODO: remove this once my ferret patch is accepted
+    q = build_query opts
+    index.search(q).total_hits
   end
 
   ## yield all messages in the thread containing 'm' by repeatedly