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

Remove unnecessary TRY() block in common/regExp module.

This code was written before MEM_CONTEXT_TEMP*() was available, which is a better solution.
This commit is contained in:
David Steele
2022-05-09 09:56:19 -04:00
parent 4d8c36715d
commit e8c40a24df
2 changed files with 8 additions and 10 deletions

View File

@ -18,7 +18,10 @@
<release-core-list> <release-core-list>
<release-bug-list> <release-bug-list>
<release-item> <release-item>
<github-pull-request id="1732"/> <commit subject="Fix error thrown from FINALLY() causing an infinite loop.">
<github-pull-request id="1732"/>
</commit>
<commit subject="Remove unnecessary TRY() block in common/regExp module."/>
<release-item-contributor-list> <release-item-contributor-list>
<release-item-contributor id="david.steele"/> <release-item-contributor id="david.steele"/>

View File

@ -179,18 +179,13 @@ regExpMatchOne(const String *expression, const String *string)
ASSERT(expression != NULL); ASSERT(expression != NULL);
ASSERT(string != NULL); ASSERT(string != NULL);
bool result = false; bool result;
RegExp *regExp = regExpNew(expression);
TRY_BEGIN() MEM_CONTEXT_TEMP_BEGIN()
{ {
result = regExpMatch(regExp, string); result = regExpMatch(regExpNew(expression), string);
} }
FINALLY() MEM_CONTEXT_TEMP_END();
{
regExpFree(regExp);
}
TRY_END();
FUNCTION_TEST_RETURN(BOOL, result); FUNCTION_TEST_RETURN(BOOL, result);
} }