fix(replay): search for route key in entire str (#35081)

fix(replay): look at whole segment string
pull/35083/head
Trey Moen 2 days ago committed by GitHub
parent e7cf508f50
commit c0b0bb554c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      tools/replay/route.cc

@ -121,7 +121,7 @@ bool Route::loadFromJson(const std::string &json) {
bool Route::loadFromLocal() {
std::string pattern = route_.timestamp + "--";
for (const auto &entry : std::filesystem::directory_iterator(data_dir_)) {
if (entry.is_directory() && entry.path().filename().string().find(pattern) == 0) {
if (entry.is_directory() && entry.path().filename().string().find(pattern) != std::string::npos) {
std::string segment = entry.path().string();
int seg_num = std::atoi(segment.substr(segment.rfind("--") + 2).c_str());

Loading…
Cancel
Save