From 3632ab0a66bd3a14c8848982b15bfa30715dded7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2016 16:16:06 +0300 Subject: Improve a bit performance in commands.cpp --- src/actions/commands.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/actions') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index fa4ea6767..a91e6f244 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -90,8 +90,11 @@ static std::string getNick(const InputEvent &event) std::string args = event.args; if (args.empty()) { - WhisperTab *const whisper = dynamic_cast(event.tab); - if (!whisper || whisper->getNick().empty()) + if (!event.tab || event.tab->getType() != ChatTabType::WHISPER) + return std::string(); + + WhisperTab *const whisper = static_cast(event.tab); + if (whisper->getNick().empty()) { if (event.tab) { -- cgit v1.2.3-60-g2f50