Do not use defer in performance-sensitive contexts

This commit is contained in:
Junegunn Choi committed 2017-08-01 03:44:55 +09:00
1 parent f4b46fad27
commit 37370f057f
3 files changed
+10 -8

No files matched your search

+1 -1
View File
@@ -205,7 +205,6 @@ func Run(opts *Options, revision string) {
delay := true
ticks++
eventBox.Wait(func(events *util.Events) {
defer events.Clear()
for evt, value := range *events {
switch evt {
@@ -265,6 +264,7 @@ func Run(opts *Options, revision string) {
}
}
}
events.Clear()
})
if delay && reading {
dur := util.DurWithin(