From: Jinhyung Jo Date: Fri, 4 Nov 2016 02:46:47 +0000 (+0900) Subject: keyboard: change the function to use X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~20^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4b3287b13f9e63aa7588d410b64428c34ed2105;p=sdk%2Femulator%2Fqemu.git keyboard: change the function to use QMap::take(const Key &key) is more efficient. Short description for take(): "Removes the item with the key from the map and returns the value associated with it." For more information, see 'http://doc.qt.io/qt-5/qmap.html#take'. And the value function is a constant function. Change-Id: Ibdaf578c6eef49ebfa8beb3a00fc61785e4b74ed Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/ui/input/keyboardshortcut.cpp b/tizen/src/ui/input/keyboardshortcut.cpp index c14f2cfdb6..a5f598c8a3 100644 --- a/tizen/src/ui/input/keyboardshortcut.cpp +++ b/tizen/src/ui/input/keyboardshortcut.cpp @@ -87,11 +87,10 @@ void KeyboardShortcut::registerHwKeyShortcuts(QList &list) void KeyboardShortcut::cancelHwKeyShortcuts(QList &list) { for (int index = 0; index < list.count(); index++) { - delete hwKeyShortcutMap.value(list.at(index)); - hwKeyShortcutMap.remove(list.at(index)); + delete hwKeyShortcutMap.take(list.at(index)); } - qDebug() << hwKeyShortcutMap.count() << "shortcuts have been registered"; + qDebug() << hwKeyShortcutMap.count() << "shortcuts have been unregistered"; } void KeyboardShortcut::slotHwKeyShortcut(int keycode)