diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-18 16:16:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-18 16:16:06 +0300 |
commit | 3632ab0a66bd3a14c8848982b15bfa30715dded7 (patch) | |
tree | 4d6864e1386f17799be24a8302214724f807f423 /src/actions/commands.cpp | |
parent | a80f8f578a78752b5b43f3aeb8759b0db4c51714 (diff) | |
download | mv-3632ab0a66bd3a14c8848982b15bfa30715dded7.tar.gz mv-3632ab0a66bd3a14c8848982b15bfa30715dded7.tar.bz2 mv-3632ab0a66bd3a14c8848982b15bfa30715dded7.tar.xz mv-3632ab0a66bd3a14c8848982b15bfa30715dded7.zip |
Improve a bit performance in commands.cpp
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<WhisperTab* const>(event.tab); - if (!whisper || whisper->getNick().empty()) + if (!event.tab || event.tab->getType() != ChatTabType::WHISPER) + return std::string(); + + WhisperTab *const whisper = static_cast<WhisperTab* const>(event.tab); + if (whisper->getNick().empty()) { if (event.tab) { |