From 801587ab6c6bcb52710c3fae136985aad7bd95eb Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 15 Apr 2021 16:56:07 +0200 Subject: [PATCH] Fix case sensitivity check for `StartsWith` and `EndsWith` in `StringView` (cherry picked from commit 752e7e73bc63b5ace47e588d1acbbe9d6be72d66) --- Source/Engine/Core/Types/StringView.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Core/Types/StringView.h b/Source/Engine/Core/Types/StringView.h index b413ff552..bbfdbccd7 100644 --- a/Source/Engine/Core/Types/StringView.h +++ b/Source/Engine/Core/Types/StringView.h @@ -160,16 +160,16 @@ public: { const int32 length = Length(); if (searchCase == StringSearchCase::IgnoreCase) - return length > 0 && _data[0] == c; - return length > 0 && StringUtils::ToLower(_data[0]) == StringUtils::ToLower(c); + return length > 0 && StringUtils::ToLower(_data[0]) == StringUtils::ToLower(c); + return length > 0 && _data[0] == c; } bool EndsWith(T c, StringSearchCase searchCase = StringSearchCase::IgnoreCase) const { const int32 length = Length(); if (searchCase == StringSearchCase::IgnoreCase) - return length > 0 && _data[length - 1] == c; - return length > 0 && StringUtils::ToLower(_data[length - 1]) == StringUtils::ToLower(c); + return length > 0 && StringUtils::ToLower(_data[length - 1]) == StringUtils::ToLower(c); + return length > 0 && _data[length - 1] == c; } bool StartsWith(const StringViewBase& prefix, StringSearchCase searchCase = StringSearchCase::IgnoreCase) const