diff --git a/main.cpp b/main.cpp index ab6545f..7b1145b 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #define K_VISION_DIR "/hard/k_vision" #define AI_VISION_DIR "/hard/ai_vision" @@ -168,7 +169,7 @@ int main(int argc, char* argv[]) { std::cout << "error: K_VISION_DIR is empty" << std::endl; return -1; } - std::vector vec_matched_path; + std::set set_matched_path; std::cout << "info: >>> match file begin <<<" << std::endl; int j = 0; for (auto it:vec_file_name) @@ -188,16 +189,16 @@ int main(int argc, char* argv[]) { auto timestamp = get_file_timestamp(path); if (timestamp >= vec_datetime.front() && timestamp <= vec_datetime.back()) { - vec_matched_path.push_back(path); + set_matched_path.insert(path); } } } std::cout << "info: match progress " << j << "/" << vec_file_name.size() << std::endl; } - std::cout << "info: >>> match file end(" << vec_matched_path.size() << ") <<<" << std::endl; + std::cout << "info: >>> match file end(" << set_matched_path.size() << ") <<<" << std::endl; std::cout << "info: >>> copy file begin <<<" << std::endl; int i = 0; - for (auto it:vec_matched_path) + for (auto it:set_matched_path) { fs::path path(it); auto strName = path.filename().string(); @@ -214,7 +215,7 @@ int main(int argc, char* argv[]) { } if (i % 50 == 0) { - std::cout << "info: copy progress " << i << "/" << vec_matched_path.size() << std::endl; + std::cout << "info: copy progress " << i << "/" << set_matched_path.size() << std::endl; } } std::cout << "info: >>> copy file end(" << i << ") <<<" << std::endl;