message: Code refactoring with std::map.
  #codehealth
diff: #include <QPushButton>
  #include <QString>
  #include <QTableWidget>
  +#include <map>
  #include <memory>
  #include "base/logging.h"
  @@ -56,13 +57,8 @@ namespace mozc {
  namespace gui {
  namespace {
  -struct QtKeyEntry {
  - Qt::Key qt_key;
  - const char *mozc_key_name;
  -};
  -
  -// TODO(taku): check it these mappings are correct.
  -const QtKeyEntry kQtKeyModifierNonRequiredTable[] = {
  +static const auto *kQtKeyModifierNonRequiredTable =
  + new std::map<const int, const char *>({
  {Qt::Key_Escape, "Escape"},
  {Qt::Key_Tab, "Tab"},
  {Qt::Key_Backtab, "Tab"}, // Qt handles Tab + Shift as a special key
  @@ -109,12 +105,12 @@ const QtKeyEntry kQtKeyModifierNonRequiredTable[] = {
  {Qt::Key_Henkan, "Henkan"},
  {Qt::Key_Hiragana, "Hiragana"},
  {Qt::Key_Katakana, "Katakana"},
  - // We need special hack for Hiragana_Katakana key. For the detail, please
  - // see KeyBindingFilter::AddKey implementation.
  + // We need special hack for Hiragana_Katakana key. For the detail,
  + // please see KeyBindingFilter::AddKey implementation.
  {Qt::Key_Hiragana_Katakana, "Hiragana"},
  {Qt::Key_Eisu_toggle, "Eisu"},
  {Qt::Key_Zenkaku_Hankaku, "Hankaku/Zenkaku"},
  -};
  + });
  #ifdef OS_WIN
  struct WinVirtualKeyEntry {
  @@ -368,13 +364,11 @@ KeyBindingFilter::KeyState KeyBindingFilter::AddKey(const QKeyEvent &key_event,
  }
  // non-printable command, which doesn't require modifier keys
  - for (size_t i = 0; i < std::size(kQtKeyModifierNonRequiredTable); ++i) {
  - if (kQtKeyModifierNonRequiredTable[i].qt_key == qt_key) {
  - modifier_non_required_key_ =
  - QLatin1String(kQtKeyModifierNonRequiredTable[i].mozc_key_name);
  + const auto it = kQtKeyModifierNonRequiredTable->find(qt_key);
  + if (it != kQtKeyModifierNonRequiredTable->end()) {
  + modifier_non_required_key_ = QLatin1String(it->second);
  return Encode(result);
  }
  - }
  #ifdef OS_WIN
  // Handle JP109's Muhenkan/Henkan/katakana-hiragana and Zenkaku/Hankaku
  