summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-08-30 18:45:52 +0200
committerGitHub <noreply@github.com>2023-08-30 18:45:52 +0200
commit82c1b4588153479099521f49d3a4d7005d9a0589 (patch)
tree53cec6e16a9338be2cc82c9a26a9c511246ac7f4 /searchcore
parent5d7333a19b84647a121217ce96d5ca50222f9e6b (diff)
parent0a6bf18f6a71c1abda345ae78fadd900d6d0476f (diff)
Merge pull request #28281 from vespa-engine/toregge/use-std-filesystem-directory-iterator-in-disk-index-cleaner-unit-test
Use std::filesystem::directory_iterator in disk index cleaner unit test.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/index/diskindexcleaner_test.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp b/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp
index e8926a957b7..7ad6d40a30e 100644
--- a/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp
+++ b/searchcore/src/tests/proton/index/diskindexcleaner_test.cpp
@@ -63,13 +63,11 @@ void createIndex(const string &name) {
vector<string> readIndexes() {
vector<string> indexes;
- FastOS_DirectoryScan dir_scan(index_dir.c_str());
- while (dir_scan.ReadNext()) {
- string name = dir_scan.GetName();
- if (!dir_scan.IsDirectory() || name.find("index.") != 0) {
- continue;
+ std::filesystem::directory_iterator dir_scan(index_dir);
+ for (auto& entry : dir_scan) {
+ if (entry.is_directory() && entry.path().filename().string().find("index.") == 0) {
+ indexes.push_back(entry.path().filename().string());
}
- indexes.push_back(name);
}
return indexes;
}