diff --git a/src/keys.cc b/src/keys.cc index e3b2f111e..f21f93ec6 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -36,7 +36,7 @@ static const KeyAndName keynamemap[] = { { "backtab", Key::BackTab }, }; -KeyList parse_keys(const String& str) +KeyList parse_keys(StringView str) { KeyList result; for (ByteCount pos = 0; pos < str.length(); ++pos) @@ -51,7 +51,7 @@ KeyList parse_keys(const String& str) { Key::Modifiers modifier = Key::Modifiers::None; - String keyname = str.substr(pos+1, end_pos - pos - 1); + auto keyname = str.substr(pos+1, end_pos - pos - 1); if (keyname.length() > 2) { if (tolower(keyname[0]) == 'c' and keyname[1] == '-') diff --git a/src/keys.hh b/src/keys.hh index de7755529..d64cee2eb 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -66,7 +66,7 @@ struct Key using KeyList = std::vector; -KeyList parse_keys(const String& str); +KeyList parse_keys(StringView str); String key_to_str(Key key); constexpr Key alt(Codepoint key) { return { Key::Modifiers::Alt, key }; }