VIM: Improve performance of folders_render
authorFranz Fellner <alpine.art.de@gmail.com>
Thu, 22 Jan 2015 20:16:47 +0000 (21:16 +0100)
committerDavid Bremner <david@tethera.net>
Fri, 23 Jan 2015 17:18:54 +0000 (18:18 +0100)
Simply use query.count_[messages,threads] instead of actually running
the query and using the count attribute of the result set.

vim/notmuch.vim

index cb6695a80715e2aa4b183a8eaee6da4ef4bc62cc..ad8b7c800cd5cca1b9b4c23fe226d57c4e414191 100644 (file)
@@ -644,7 +644,7 @@ ruby << EOF
                                        q.add_tag_exclude(t)
                                }
                                $searches << search
-                               count = count_threads ? q.search_threads.count : q.search_messages.count
+                               count = count_threads ? q.count_threads : q.count_messages
                                b << "%9d %-20s (%s)" % [count, name, search]
                        end
                end