MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FindKey

Function FindKey

src/network/network.cpp:170–173  ·  view source on GitHub ↗

* Simple helper to find the location of the given authorized key in the authorized keys. * @param authorized_keys The keys to look through. * @param authorized_key The key to look for. * @return The iterator to the location of the authorized key, or \c authorized_keys.end(). */

Source from the content-addressed store, hash-verified

168 * @return The iterator to the location of the authorized key, or \c authorized_keys.end().
169 */
170static auto FindKey(auto *authorized_keys, std::string_view authorized_key)
171{
172 return std::ranges::find_if(*authorized_keys, [authorized_key](auto &value) { return StrEqualsIgnoreCase(value, authorized_key); });
173}
174
175/**
176 * Check whether the given key is contains in these authorized keys.

Callers 3

ContainsMethod · 0.85
AddMethod · 0.85
RemoveMethod · 0.85

Calls 1

StrEqualsIgnoreCaseFunction · 0.85

Tested by

no test coverage detected