diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-01 03:39:57 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-01 03:44:55 +0900 |
commit | 37370f057f5f39a54316bc7a048ab12b35004b7c (patch) | |
tree | 5acdc5b539fc785ffbceca1ee88948c02a1ab139 /src/core.go | |
parent | f4b46fad27b4d4f7f3f5649b5f2948c298c3a5ae (diff) |
Do not use defer in performance-sensitive contexts
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core.go b/src/core.go index 74ff9e7f..0b90a51b 100644 --- a/src/core.go +++ b/src/core.go @@ -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( |