You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-11-06 08:49:29 +02:00
Inline strSize().
Inlining strPtr() in fbff2995 does not seem to have caused any problems so do the same with strSize().
This commit is contained in:
@@ -801,19 +801,6 @@ strSubN(const String *this, size_t start, size_t size)
|
||||
FUNCTION_TEST_RETURN(strNewN(this->buffer + start, size));
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
size_t
|
||||
strSize(const String *this)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(STRING, this);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
|
||||
FUNCTION_TEST_RETURN(this->size);
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
String *
|
||||
strTrim(String *this)
|
||||
|
||||
@@ -152,7 +152,12 @@ String *strQuoteZ(const String *this, const char *quote);
|
||||
String *strReplaceChr(String *this, char find, char replace);
|
||||
|
||||
// String size minus null-terminator, i.e. the same value that strlen() would return
|
||||
size_t strSize(const String *this);
|
||||
__attribute__((always_inline)) static inline size_t
|
||||
strSize(const String *this)
|
||||
{
|
||||
ASSERT_INLINE(this != NULL);
|
||||
return ((const StringConst *)this)->size;
|
||||
}
|
||||
|
||||
// Format sizes (file, buffer, etc.) in human-readable form
|
||||
String *strSizeFormat(const uint64_t fileSize);
|
||||
|
||||
Reference in New Issue
Block a user