From 8c68713f0c0ecb2ded05e93c68f5aa60640b60e4 Mon Sep 17 00:00:00 2001 From: acetone Date: Mon, 24 May 2021 14:56:31 +0300 Subject: [PATCH] sorted search --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a2db940..b9da4c6 100644 --- a/main.cpp +++ b/main.cpp @@ -58,7 +58,7 @@ std::string search(std::string text) } if (matches.size() > 0) { - std::reverse(matches.begin(), matches.end()); + std::sort(matches.begin(), matches.end()); values += "(" + std::to_string(success) + ") "; for (int i = matches.size()-1, count = 0; i >= 0 && count < maxSize ; --i, ++count)