bug-zile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-zile] [PATCH 2/2] refactor: no need to consecutively reclear the mi


From: Gary V. Vaughan
Subject: [Bug-zile] [PATCH 2/2] refactor: no need to consecutively reclear the minibuf.
Date: Sun, 27 May 2012 22:43:22 +0700

This seems to reduce CPU load by about 75% when pasting a large
amount of text, and is worth applying independently of whether
my previous patch makes sense, I think...

* src/minibuf.c (minibuf_clear): If the minibuf is already clear,
avoid re-clearing it.
---
 src/minibuf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/minibuf.c b/src/minibuf.c
index 3c555a6..eee8ea5 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -335,5 +335,6 @@ minibuf_vread_completion (const char *fmt, const char 
*value, Completion * cp,
 void
 minibuf_clear (void)
 {
-  minibuf_write ("");
+  if (minibuf_contents == NULL || *minibuf_contents != 0)
+    minibuf_write ("");
 }
-- 
1.7.10.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]