From 1db68a3976cfb10ed7d6ab88d7b468bb1b93ee34 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 11 Jan 2015 21:56:55 +0900 Subject: [PATCH] Avoid unnecessary update of search progress --- src/terminal.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/terminal.go b/src/terminal.go index 7039e57..7d8bc5b 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -94,9 +94,14 @@ func (t *Terminal) UpdateCount(cnt int, final bool) { func (t *Terminal) UpdateProgress(progress float32) { t.mutex.Lock() - t.progress = int(progress * 100) + newProgress := int(progress * 100) + changed := t.progress != newProgress + t.progress = newProgress t.mutex.Unlock() - t.reqBox.Set(REQ_INFO, nil) + + if changed { + t.reqBox.Set(REQ_INFO, nil) + } } func (t *Terminal) UpdateList(merger *Merger) {