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

Function ExtractNetworkRevisionHash

src/network/core/network_game_info.cpp:92–97  ·  view source on GitHub ↗

* Extract the git hash from the revision string. * @param revision_string The revision string (formatted as DATE-BRANCH-GITHASH). * @return The git has part of the revision. */

Source from the content-addressed store, hash-verified

90 * @return The git has part of the revision.
91 */
92static std::string_view ExtractNetworkRevisionHash(std::string_view revision_string)
93{
94 size_t index = revision_string.find_last_of('-');
95 if (index == std::string::npos) return {};
96 return revision_string.substr(index);
97}
98
99/**
100 * Checks whether the given version string is compatible with our version.

Callers 1

Calls 1

substrMethod · 0.80

Tested by

no test coverage detected