diff --git a/include/core/SkString.h b/include/core/SkString.h index a2579d913..743f07889 100644 --- a/include/core/SkString.h +++ b/include/core/SkString.h @@ -168,7 +168,6 @@ public: void insertScalar(size_t offset, SkScalar); void append(const SkString& str) { this->insert((size_t)-1, str); } - void append(const char c) { this->insert((size_t)-1, &c, 1); } void append(const char text[]) { this->insert((size_t)-1, text); } void append(const char text[], size_t len) { this->insert((size_t)-1, text, len); } void appendUnichar(SkUnichar uni) { this->insertUnichar((size_t)-1, uni); } @@ -195,7 +194,7 @@ public: SkString& operator+=(const SkString& s) { this->append(s); return *this; } SkString& operator+=(const char text[]) { this->append(text); return *this; } - SkString& operator+=(const char c) { this->append(c); return *this; } + SkString& operator+=(const char c) { this->append(&c, 1); return *this; } /** * Swap contents between this and other. This function is guaranteed diff --git a/tests/StringTest.cpp b/tests/StringTest.cpp index 487876490..2c5026c68 100644 --- a/tests/StringTest.cpp +++ b/tests/StringTest.cpp @@ -92,18 +92,6 @@ static void TestString(skiatest::Reporter* reporter) { f.prepend("hello "); REPORTER_ASSERT(reporter, a.equals("hello world") && a == e && a == f); - a.reset(); - a.append(SkString("string")); - a.append("text"); - a.append('c'); - REPORTER_ASSERT(reporter, a.equals("stringtextc")); - - a.reset(); - a += 'c'; - a += "text"; - a += SkString("string"); - REPORTER_ASSERT(reporter, a.equals("ctextstring")); - a.reset(); b.resize(0); REPORTER_ASSERT(reporter, a.isEmpty() && b.isEmpty() && a == b);