apps/gophers: simplify type switch

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-12 15:41:10 +02:00
parent 1336ca109a
commit 759fdb2efe
+8 -10
View File
@@ -198,16 +198,14 @@ func (a *App) run() error {
a.w.Redraw()
case e := <-a.w.Events():
switch e := e.(type) {
case input.Event:
if e, ok := e.(key.ChordEvent); ok {
switch e.Name {
case key.NameEscape:
os.Exit(0)
case 'P':
if e.Modifiers.Contain(key.ModCommand) {
a.profiling = !a.profiling
a.w.Redraw()
}
case key.ChordEvent:
switch e.Name {
case key.NameEscape:
os.Exit(0)
case 'P':
if e.Modifiers.Contain(key.ModCommand) {
a.profiling = !a.profiling
a.w.Redraw()
}
}
case app.StageEvent: