1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Improve result declaration in backupRegExp().

No need to set this to NULL when the initial value can be used instead.
This commit is contained in:
David Steele 2022-04-25 14:14:29 -04:00
parent 5b5dbe0e7e
commit 9314be36b1

View File

@ -56,7 +56,7 @@ backupLabelFormat(BackupType type, const String *backupLabelPrior, time_t timest
/**********************************************************************************************************************************/
String *
backupRegExp(BackupRegExpParam param)
backupRegExp(const BackupRegExpParam param)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
FUNCTION_LOG_PARAM(BOOL, param.full);
@ -67,10 +67,8 @@ backupRegExp(BackupRegExpParam param)
ASSERT(param.full || param.differential || param.incremental);
String *result = NULL;
// Start the expression with the anchor, date/time regexp and full backup indicator
result = strCatZ(strNew(), "^" DATE_TIME_REGEX "F");
String *const result = strCatZ(strNew(), "^" DATE_TIME_REGEX "F");
// Add the diff and/or incr expressions if requested
if (param.differential || param.incremental)