string: cleanup

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman
2025-09-11 15:00:01 +02:00
parent 0f57f7de35
commit 0e091003b6

View File

@@ -1181,9 +1181,8 @@ namespace stdex
{
stdex_assert(str1);
stdex_assert(str2);
size_t i;
unsigned int a, b;
for (i = 0; ; ++i) {
for (size_t i = 0; ; ++i) {
a = static_cast<unsigned int>(tolower(str1[i]));
b = static_cast<unsigned int>(tolower(str2[i]));
if (!a && !b) return 0;
@@ -1206,11 +1205,10 @@ namespace stdex
{
stdex_assert(str1);
stdex_assert(str2);
size_t i;
unsigned int a, b;
const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
for (i = 0;; ++i) {
for (size_t i = 0;; ++i) {
a = static_cast<unsigned int>(ctype1.tolower(str1[i]));
b = static_cast<unsigned int>(ctype2.tolower(str2[i]));
if (!a && !b) return 0;