提交 099d1b87 编写于 作者: M Megvii Engine Team

fix(lite/load_and_run): fix suffix parse error

GitOrigin-RevId: 8a9dac219e62ca53c33a6f097eba57b62051c8e2
上级 714340e9
......@@ -30,7 +30,12 @@ void DataParser::feed(const std::string& path) {
}
auto endWith = [blob_string](std::string suffix) -> bool {
return blob_string.rfind(suffix) == (blob_string.length() - suffix.length());
const auto index = blob_string.rfind(suffix);
if (index != std::string::npos and
index == blob_string.length() - suffix.length()) {
return true;
}
return false;
};
if (endWith(".ppm") || endWith(".pgm")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册