From 9434f59c178ed8fddb96159101e8bb6d09ddf6d6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 12 Apr 2021 13:38:31 -0700 Subject: [PATCH] Remove String8::toUpper(). Actually, it looks like it's only toLower() that's used, so let's remove toUpper() separately, since it's so easy. Test: treehugger Change-Id: I8fae9fa513b2a34d5bd6b3f64e9305a1ee3c1ec4 --- libutils/String8.cpp | 13 ------------- libutils/String8_fuzz.cpp | 3 --- libutils/include/utils/String8.h | 1 - 3 files changed, 17 deletions(-) diff --git a/libutils/String8.cpp b/libutils/String8.cpp index fad130b1b..2974aa300 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp @@ -426,19 +426,6 @@ void String8::toLower() unlockBuffer(length); } -void String8::toUpper() -{ - const size_t length = size(); - if (length == 0) return; - - char* buf = lockBuffer(length); - for (size_t i = length; i > 0; --i) { - *buf = static_cast(toupper(*buf)); - buf++; - } - unlockBuffer(length); -} - // --------------------------------------------------------------------------- // Path functions diff --git a/libutils/String8_fuzz.cpp b/libutils/String8_fuzz.cpp index b02683c42..a45d67514 100644 --- a/libutils/String8_fuzz.cpp +++ b/libutils/String8_fuzz.cpp @@ -41,9 +41,6 @@ std::vector void { - str1->toUpper(); - }, [](FuzzedDataProvider*, android::String8* str1, android::String8*) -> void { str1->toLower(); }, diff --git a/libutils/include/utils/String8.h b/libutils/include/utils/String8.h index 84f14d073..cee5dc640 100644 --- a/libutils/include/utils/String8.h +++ b/libutils/include/utils/String8.h @@ -130,7 +130,6 @@ public: bool removeAll(const char* other); void toLower(); - void toUpper(); /*