From 4774f0e1a2a1f4256b8a3f1bd8fd9c1667472edd Mon Sep 17 00:00:00 2001 From: Andreas Drewke Date: Fri, 17 Nov 2023 19:20:33 +0100 Subject: [PATCH] tools/cli/sortincludes: some small improvement --- src/tdme/tools/cli/sortincludes-main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tdme/tools/cli/sortincludes-main.cpp b/src/tdme/tools/cli/sortincludes-main.cpp index 20a6e87df..ce2d5e9af 100644 --- a/src/tdme/tools/cli/sortincludes-main.cpp +++ b/src/tdme/tools/cli/sortincludes-main.cpp @@ -63,7 +63,7 @@ void scanDir(const string& folder, vector& totalFiles) { } } -static int string_compare(const string& lhs, const string& rhs) { +static int compare_includes(const string& lhs, const string& rhs) { if (StringTools::startsWith(lhs, "#include ") == true) return true; else if (StringTools::startsWith(rhs, "#include ") == true) return false; auto charCount = Math::min((int32_t)lhs.size(), (int32_t)rhs.size()); @@ -116,7 +116,7 @@ void parseHpp(const string& fileName) { if (hadTDMEHInclude == false) hadTDMEHInclude = StringTools::trim(line) == "#include "; } else if (startLineIdx != -1 && endLineIdx != -1) { - sort(newFileContent.begin() + startLineIdx, newFileContent.begin() + endLineIdx + 1, string_compare); + sort(newFileContent.begin() + startLineIdx, newFileContent.begin() + endLineIdx + 1, compare_includes); startLineIdx = -1; endLineIdx = -1; } @@ -150,7 +150,7 @@ void parseHpp(const string& fileName) { } } else if (startLineIdx != -1 && endLineIdx != -1) { - sort(newFileContent.begin() + startLineIdx, newFileContent.begin() + endLineIdx + 1, string_compare); + sort(newFileContent.begin() + startLineIdx, newFileContent.begin() + endLineIdx + 1, compare_includes); startLineIdx = -1; endLineIdx = -1; }