From c4b3287b13f9e63aa7588d410b64428c34ed2105 Mon Sep 17 00:00:00 2001 From: Jinhyung Jo Date: Fri, 4 Nov 2016 11:46:47 +0900 Subject: 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 --- tizen/src/ui/input/keyboardshortcut.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tizen') 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) -- cgit v1.2.3