mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Optimised performance of String::isEmpty()
This commit is contained in:
parent
c240ca4eaf
commit
c66f412224
2 changed files with 5 additions and 5 deletions
|
|
@ -1617,10 +1617,10 @@ String String::upToLastOccurrenceOf (StringRef sub,
|
|||
|
||||
bool String::isQuotedString() const
|
||||
{
|
||||
const String trimmed (trimStart());
|
||||
const juce_wchar trimmedStart = trimStart()[0];
|
||||
|
||||
return trimmed[0] == '"'
|
||||
|| trimmed[0] == '\'';
|
||||
return trimmedStart == '"'
|
||||
|| trimmedStart == '\'';
|
||||
}
|
||||
|
||||
String String::unquoted() const
|
||||
|
|
|
|||
|
|
@ -299,13 +299,13 @@ public:
|
|||
Note that there's also an isNotEmpty() method to help write readable code.
|
||||
@see containsNonWhitespaceChars()
|
||||
*/
|
||||
inline bool isEmpty() const noexcept { return text[0] == 0; }
|
||||
inline bool isEmpty() const noexcept { return text.isEmpty(); }
|
||||
|
||||
/** Returns true if the string contains at least one character.
|
||||
Note that there's also an isEmpty() method to help write readable code.
|
||||
@see containsNonWhitespaceChars()
|
||||
*/
|
||||
inline bool isNotEmpty() const noexcept { return text[0] != 0; }
|
||||
inline bool isNotEmpty() const noexcept { return ! text.isEmpty(); }
|
||||
|
||||
/** Resets this string to be empty. */
|
||||
void clear() noexcept;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue