mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Add easy way to verify games against the Redump database, supplied as CSV.
This commit is contained in:
@@ -45,6 +45,14 @@ inline bool startsWith(const std::string &str, const char *key) {
|
||||
return !memcmp(str.data(), key, keyLen);
|
||||
}
|
||||
|
||||
// Optimized for string views.
|
||||
inline bool startsWith(std::string_view str, std::string_view key) {
|
||||
size_t keyLen = key.size();
|
||||
if (str.size() < keyLen)
|
||||
return false;
|
||||
return !memcmp(str.data(), key.data(), keyLen);
|
||||
}
|
||||
|
||||
inline bool startsWith(const std::string &str, const std::string &what) {
|
||||
if (str.size() < what.size())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user