From 376bd5a6d858fee204379e813b91f651011301a7 Mon Sep 17 00:00:00 2001 From: Binbin Date: Thu, 21 Nov 2024 20:42:39 +0800 Subject: [PATCH] apply zuiderkwast suggestion Signed-off-by: Binbin --- src/functions.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/functions.c b/src/functions.c index 3f67816e91..916d8fd622 100644 --- a/src/functions.c +++ b/src/functions.c @@ -186,12 +186,16 @@ void functionsLibCtxClearCurrent(int async) { } /* Free the given functions ctx */ -void functionsLibCtxFreeGeneric(functionsLibCtx *functions_lib_ctx, int async) { +static void functionsLibCtxFreeGeneric(functionsLibCtx *functions_lib_ctx, int async) { if (async) { freeFunctionsAsync(functions_lib_ctx); - return; + } else { + functionsLibCtxFree(functions_lib_ctx); } +} +/* Free the given functions ctx */ +void functionsLibCtxFree(functionsLibCtx *functions_lib_ctx) { functionsLibCtxClear(functions_lib_ctx); dictRelease(functions_lib_ctx->functions); dictRelease(functions_lib_ctx->libraries); @@ -199,11 +203,6 @@ void functionsLibCtxFreeGeneric(functionsLibCtx *functions_lib_ctx, int async) { zfree(functions_lib_ctx); } -/* Free the given functions ctx */ -void functionsLibCtxFree(functionsLibCtx *functions_lib_ctx) { - functionsLibCtxFreeGeneric(functions_lib_ctx, 0); -} - /* Swap the current functions ctx with the given one. * Free the old functions ctx. */ void functionsLibCtxSwapWithCurrent(functionsLibCtx *new_lib_ctx, int async) {