From d32ba202f06b8f85a60d4bb0e4592f8167ddb4cf Mon Sep 17 00:00:00 2001 From: Jordan Cheney Date: Fri, 18 Jul 2014 10:12:20 -0400 Subject: [PATCH] More efficient hash-based search in getNumberOfImages --- openbr/core/eval.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 2e69e65..2e971b0 100755 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -747,12 +747,11 @@ static QMap getDetections(const File &predictedGallery, con static int getNumberOfImages(const File &truthGallery) { - const FileList files = TemplateList::fromGallery(truthGallery).files(); + const FileList files = FileList::fromGallery(truthGallery); - QStringList names; - foreach(const File file, files) - if (!names.contains(file.fileName())) - names.append(file.fileName()); + QSet names; + foreach(const File &file, files) + names.insert(file.fileName()); return names.size(); } -- libgit2 0.21.4