mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-03-05 15:05:48 +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:
parent
4d8c36715d
commit
e8c40a24df
@ -18,7 +18,10 @@
|
||||
<release-core-list>
|
||||
<release-bug-list>
|
||||
<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 id="david.steele"/>
|
||||
|
@ -179,18 +179,13 @@ regExpMatchOne(const String *expression, const String *string)
|
||||
ASSERT(expression != NULL);
|
||||
ASSERT(string != NULL);
|
||||
|
||||
bool result = false;
|
||||
RegExp *regExp = regExpNew(expression);
|
||||
bool result;
|
||||
|
||||
TRY_BEGIN()
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
result = regExpMatch(regExp, string);
|
||||
result = regExpMatch(regExpNew(expression), string);
|
||||
}
|
||||
FINALLY()
|
||||
{
|
||||
regExpFree(regExp);
|
||||
}
|
||||
TRY_END();
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
FUNCTION_TEST_RETURN(BOOL, result);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user