1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-10-30 23:37:45 +02:00

Remove context wrapper when processing defaults during config parsing.

Once upon a time storing the default required creating a new string that needed to be assigned to the config mem context but that was a very long time ago and now only constants are used, so no need for a context switch.
This commit is contained in:
David Steele
2025-05-04 13:56:13 -04:00
parent beeb93225f
commit 975516ae6d

View File

@@ -2643,16 +2643,8 @@ cfgParse(const Storage *const storage, const unsigned int argListSize, const cha
// Else try to set a default
else
{
bool found = false;
MEM_CONTEXT_BEGIN(config->memContext)
{
found = cfgParseOptionalRule(&optionalRules, parseRuleOptionalTypeDefault, config->command, optionId);
}
MEM_CONTEXT_END();
// If the option has a default
if (found)
if (cfgParseOptionalRule(&optionalRules, parseRuleOptionalTypeDefault, config->command, optionId))
{
configOptionValue->set = true;
configOptionValue->value = optionalRules.defaultValue;