1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Designated initializer cleanup.

Cleanup designated initializers created in b134175f by moving struct members in or out for clarity.
This commit is contained in:
Cynthia Shang
2020-01-27 17:50:07 -07:00
committed by David Steele
parent 24d2494c82
commit 324f7cebe0
3 changed files with 6 additions and 4 deletions

View File

@ -783,15 +783,15 @@ restoreCleanBuild(Manifest *manifest)
{
.manifest = manifest,
.target = manifestTarget(manifest, targetIdx),
.delta = delta,
.fileIgnore = strLstNew(),
};
cleanData->targetName = cleanData->target->name;
cleanData->targetPath = manifestTargetPath(manifest, cleanData->target);
cleanData->basePath = strEq(cleanData->targetName, MANIFEST_TARGET_PGDATA_STR);
cleanData->delta = delta;
// Ignore backup.manifest while cleaning since it may exist from an prior incomplete restore
cleanData->fileIgnore = strLstNew();
strLstAdd(cleanData->fileIgnore, BACKUP_MANIFEST_FILE_STR);
// Also ignore recovery files when recovery type = preserve

View File

@ -76,10 +76,11 @@ dbNew(PgClient *client, ProtocolClient *remoteClient, const String *applicationN
*this = (Db)
{
.memContext = memContextCurrent(),
.client = pgClientMove(client, memContextCurrent()),
.remoteClient = remoteClient,
.applicationName = strDup(applicationName),
};
this->client = pgClientMove(client, this->memContext);
}
MEM_CONTEXT_NEW_END();

View File

@ -52,8 +52,9 @@ protocolParallelJobNew(const Variant *key, ProtocolCommand *command)
.memContext = memContextCurrent(),
.state = protocolParallelJobStatePending,
.key = varDup(key),
.command = protocolCommandMove(command, memContextCurrent()),
};
this->command = protocolCommandMove(command, this->memContext);
}
MEM_CONTEXT_NEW_END();