From ecccae530c85974d4686f4037181f574116de5ae Mon Sep 17 00:00:00 2001 From: Pranav Srinivas Kumar Date: Sat, 4 Nov 2023 15:48:13 -0500 Subject: [PATCH] Using size_t for levenshtein distance --- include/argparse/argparse.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index efbf3c46..1d4938b5 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -481,10 +481,10 @@ std::string_view get_most_similar_string(const std::map &map, const std::string_view input) { std::string_view most_similar{}; - int min_distance = std::numeric_limits::max(); + std::size_t min_distance = std::numeric_limits::max(); for (const auto &entry : map) { - int distance = get_levenshtein_distance(entry.first, input); + std::size_t distance = get_levenshtein_distance(entry.first, input); if (distance < min_distance) { min_distance = distance; most_similar = entry.first;