Skip to content

Commit

Permalink
perf: adb config cache不存在时返回默认adb config
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Nov 25, 2023
1 parent 7a6493f commit ea88473
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/cli/Cache/AdbConfigCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ std::string AdbConfigCache::get_adb_config(const std::string& device_name, const
std::string cache_key = generate_cache_key(device_name, device_SN);
std::string adb_config;
if (!load(cache_key, adb_config)) {
return std::string();
return get_default_adb_config();
}
return adb_config;
}
Expand Down
7 changes: 1 addition & 6 deletions source/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ int main(int argc, char** argv)
config.init();

AdbConfigCache adb_config_cache;
if (!adb_config_cache.has(device.get_config_device_name(), device.get_config_device_SN())) {
adb_config = adb_config_cache.get_default_adb_config();
}
else {
adb_config = adb_config_cache.get_adb_config(device.get_config_device_name(), device.get_config_device_SN());
}
adb_config = adb_config_cache.get_adb_config(device.get_config_device_name(), device.get_config_device_SN());

bool identified = app_package_and_activity(control.get_config_server(), package, activity);
if (!identified) {
Expand Down

0 comments on commit ea88473

Please sign in to comment.