DRY map lookup

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2017-10-06 12:16:54 +01:00
parent 91ba939e23
commit 152499a17d
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E
1 changed files with 1 additions and 1 deletions

View File

@ -310,7 +310,7 @@ const stateHandlers = {
module.exports = {
textForEvent: function(ev) {
const handler = ev.isState() ? stateHandlers[ev.getType()] : handlers[ev.getType()];
const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];
if (handler) return handler(ev);
return '';
},