[PATCH 8/9] vim: run(): optimize non-debug path

Subject: [PATCH 8/9] vim: run(): optimize non-debug path

Date: Sat, 5 Jun 2010 14:12:41 +0300

To: notmuch@notmuchmail.org

Cc: Bart Trojanowski

From: Felipe Contreras


Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 vim/plugin/notmuch.vim |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim
index 7b49015..8d5d1c3 100644
--- a/vim/plugin/notmuch.vim
+++ b/vim/plugin/notmuch.vim
@@ -1186,13 +1186,16 @@ function! s:NM_run(args)
         call map(words, 's:NM_shell_escape(v:val)')
         let cmd = g:notmuch_cmd . ' ' . join(words) . '< /dev/null'
 
-        let start = reltime()
-        let out = system(cmd)
-        let err = v:shell_error
-        let delta = reltime(start)
-
         if exists('g:notmuch_debug') && g:notmuch_debug
+                let start = reltime()
+                let out = system(cmd)
+                let err = v:shell_error
+                let delta = reltime(start)
+
                 echo printf('[%s] {%s} %s', reltimestr(delta), string(err), string(cmd))
+        else
+                let out = system(cmd)
+                let err = v:shell_error
         endif
 
         if err
-- 
1.7.1


Thread: