Skip to content
Permalink
Browse files
Drop unused appendNumber(Vector<CharacterType>& vector, unsigned char…
…) function

https://bugs.webkit.org/show_bug.cgi?id=240387

Reviewed by Darin Adler.

* Source/WTF/wtf/text/WTFString.h:
(WTF::appendNumber): Deleted.

Canonical link: https://commits.webkit.org/250555@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed May 14, 2022
1 parent 1a36298 commit 8ad0da241295cf67f4ac9fdd3566a2b77b01e630
Showing with 0 additions and 26 deletions.
  1. +0 −26 Source/WTF/wtf/text/WTFString.h
@@ -377,8 +377,6 @@ NSString * nsStringNilIfEmpty(const String&);
WTF_EXPORT_PRIVATE int codePointCompare(const String&, const String&);
bool codePointCompareLessThan(const String&, const String&);

template<typename CharacterType> void appendNumber(Vector<CharacterType>&, unsigned char number);

// Shared global empty and null string.
struct StaticString {
constexpr StaticString(StringImpl::StaticStringImpl* pointer)
@@ -545,29 +543,6 @@ inline bool codePointCompareLessThan(const String& a, const String& b)
return codePointCompare(a.impl(), b.impl()) < 0;
}

template<typename CharacterType>
inline void appendNumber(Vector<CharacterType>& vector, unsigned char number)
{
int numberLength = number > 99 ? 3 : (number > 9 ? 2 : 1);
size_t vectorSize = vector.size();
vector.grow(vectorSize + numberLength);

switch (numberLength) {
case 3:
vector[vectorSize + 2] = number % 10 + '0';
number /= 10;
FALLTHROUGH;

case 2:
vector[vectorSize + 1] = number % 10 + '0';
number /= 10;
FALLTHROUGH;

case 1:
vector[vectorSize] = number % 10 + '0';
}
}

inline String String::fromUTF8(const Vector<LChar>& characters)
{
if (characters.isEmpty())
@@ -633,7 +608,6 @@ inline String operator"" _str(const char* characters, size_t)
using WTF::HashTranslatorASCIILiteral;
using WTF::KeepTrailingZeros;
using WTF::String;
using WTF::appendNumber;
using WTF::charactersToDouble;
using WTF::charactersToFloat;
using WTF::emptyString;

0 comments on commit 8ad0da2

Please sign in to comment.