Minor fixes for rknn (#1925)

This commit is contained in:
Fangjun Kuang
2025-02-26 16:26:18 +08:00
committed by GitHub
parent 2f9a2b20a1
commit 82cb8a5dc3
7 changed files with 46 additions and 5 deletions

View File

@@ -699,4 +699,12 @@ std::string ToString(const std::wstring &s) {
return converter.to_bytes(s);
}
bool EndsWith(const std::string &haystack, const std::string &needle) {
if (needle.size() > haystack.size()) {
return false;
}
return std::equal(needle.rbegin(), needle.rend(), haystack.rbegin());
}
} // namespace sherpa_onnx