1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-06-20 01:17:49 +02:00

Remove unused error parameter from strIdFromZN().

This parameter was made obsolete in 85caeda4.
This commit is contained in:
David Steele
2026-01-11 18:42:27 +07:00
parent d12aa6fcda
commit d76da852ee
4 changed files with 5 additions and 8 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ FN_EXTERN String *strSizeFormat(const uint64_t fileSize);
FN_INLINE_ALWAYS StringId
strStrId(const String *const this)
{
return strIdFromZN(strZ(this), strSize(this), true);
return strIdFromZN(strZ(this), strSize(this));
}
// Return a substring given only the start position
+2 -3
View File
@@ -223,12 +223,11 @@ strIdBitFromZN(const StringIdBit bit, const char *const buffer, size_t size)
}
FN_EXTERN StringId
strIdFromZN(const char *const buffer, const size_t size, const bool error)
strIdFromZN(const char *const buffer, const size_t size)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(VOID, buffer);
FUNCTION_TEST_PARAM(SIZE, size);
FUNCTION_TEST_PARAM(BOOL, error);
FUNCTION_TEST_END();
StringId result = strIdBitFromZN(stringIdBit5, buffer, size);
@@ -239,7 +238,7 @@ strIdFromZN(const char *const buffer, const size_t size, const bool error)
result = strIdBitFromZN(stringIdBit6, buffer, size);
// Error when 6-bit encoding also fails
if (result == 0 && error)
if (result == 0)
THROW_FMT(FormatError, "'%s' contains invalid characters", buffer);
}
+2 -2
View File
@@ -60,13 +60,13 @@ against each other so the str parameter is included only for documentation purpo
Functions
***********************************************************************************************************************************/
// Convert N chars to StringId
FN_EXTERN StringId strIdFromZN(const char *buffer, size_t size, bool error);
FN_EXTERN StringId strIdFromZN(const char *buffer, size_t size);
// Convert zero-terminated string to StringId using strIdFromZN()
FN_INLINE_ALWAYS StringId
strIdFromZ(const char *const str)
{
return strIdFromZN(str, strlen(str), true);
return strIdFromZN(str, strlen(str));
}
// Write StringId to characters without zero-terminating. The buffer at ptr must have enough space to write the entire StringId,
-2
View File
@@ -630,8 +630,6 @@ testRun(void)
TEST_RESULT_UINT(strIdBitFromZN(stringIdBit6, "abC-40MzZ9", 10), TEST_STR6ID10, "6 bits 10 chars");
TEST_RESULT_UINT(strIdBitFromZN(stringIdBit6, "abC-40MzZ9Z", 11), 0, "error on too many chars");
TEST_RESULT_UINT(strIdFromZN("|B", 2, false), 0, "'|' is invalid for 6-bit encoding in '|B'");
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("STRID*()");