Skip to content

Commit

Permalink
Update ASCIILiteral's operator[] to take in a size_t instead of an …
Browse files Browse the repository at this point in the history
…`unsigned`

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

Reviewed by Keith Miller.

This matches the type returned by ASCIILiteral::length().

* Source/WTF/wtf/text/ASCIILiteral.h:

Canonical link: https://commits.webkit.org/278725@main
  • Loading branch information
cdumez committed May 14, 2024
1 parent 4a635aa commit 4d22a2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/WTF/wtf/text/ASCIILiteral.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class ASCIILiteral final {
std::span<const LChar> span8() const { return { characters8(), length() }; }
size_t isEmpty() const { return m_charactersWithNullTerminator.size() <= 1; }

constexpr char operator[](unsigned index) const { return m_charactersWithNullTerminator[index]; }
constexpr char characterAt(unsigned index) const { return m_charactersWithNullTerminator[index]; }
constexpr char operator[](size_t index) const { return m_charactersWithNullTerminator[index]; }
constexpr char characterAt(size_t index) const { return m_charactersWithNullTerminator[index]; }

#ifdef __OBJC__
// This function convert null strings to empty strings.
Expand Down

0 comments on commit 4d22a2b

Please sign in to comment.