Skip to content

Commit f35915d

Browse files
Fix build errors.
* Follow-up to cl/730746292 #codehealth PiperOrigin-RevId: 731116201
1 parent 55e2e72 commit f35915d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/unix/ibus/key_translator.cc

+7-6
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ struct Kana {
156156
constexpr bool operator<(const Kana &other) const {
157157
return std::tie(non_shift, shift) < std::tie(other.non_shift, other.shift);
158158
}
159-
}
159+
};
160160

161161
// Stores a mapping from ASCII to Kana character. For example, ASCII character
162162
// '4' is mapped to Japanese 'Hiragana Letter U' (without Shift modifier) and
163163
// 'Hiragana Letter Small U' (with Shift modifier).
164164
// TODO(team): Add kana_map_dv to support Dvoraklayout.
165-
constexpr KanaMap kKanaJpMap = CreateFlatMap<uint, Kana>({
165+
constexpr auto kKanaJpMap = CreateFlatMap<uint, Kana>({
166166
{'1', {"", ""}},
167167
{'!', {"", ""}},
168168
{'2', {"", ""}},
@@ -341,11 +341,12 @@ bool KeyTranslator::Translate(uint keyval, uint keycode, uint modifiers,
341341
out_event->add_modifier_keys(commands::KeyEvent::CAPS);
342342
}
343343
out_event->set_key_code(keyval);
344-
} else if (auto it = kIbusModifierMaskMap->find(keyval);
345-
it != kIbusModifierMaskMap->end()) {
344+
} else if (const uint *mask = kIbusModifierMaskMap.FindOrNull(keyval);
345+
mask != nullptr) {
346346
// Convert Ibus modifier key to mask (e.g. IBUS_Shift_L to IBUS_SHIFT_MASK)
347-
modifiers |= it->second;
348-
} else if (const absl::string_view *key = kSpecialKeyMap->FindOrNull(keyval);
347+
modifiers |= *mask;
348+
} else if (const commands::KeyEvent::SpecialKey *key =
349+
kSpecialKeyMap.FindOrNull(keyval);
349350
key != nullptr) {
350351
out_event->set_special_key(*key);
351352
} else {

0 commit comments

Comments
 (0)