From fa05f1bdbff86d21f725960188ec2dc540e518b0 Mon Sep 17 00:00:00 2001 From: Zach Neumann Date: Thu, 3 Aug 2023 09:49:59 -0600 Subject: [PATCH] chore: rename function to be more descriptive --- agent/php_wrapper.c | 12 ++++++------ agent/php_wrapper.h | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/agent/php_wrapper.c b/agent/php_wrapper.c index b00935da5..6a3ee536d 100644 --- a/agent/php_wrapper.c +++ b/agent/php_wrapper.c @@ -25,8 +25,8 @@ nruserfn_t* nr_php_wrap_user_function_before_after_clean_with_transience( /* If any of the callbacks we are attempting to set are already set to * something else, we want to exit without setting new callbacks */ - if (is_instrumentation_set(wraprec->special_instrumentation, - after_callback)) { + if (is_instrumentation_set_and_not_equal(wraprec->special_instrumentation, + after_callback)) { nrl_verbosedebug( NRL_INSTRUMENT, "%s: attempting to set special_instrumentation for %.*s, but " @@ -35,8 +35,8 @@ nruserfn_t* nr_php_wrap_user_function_before_after_clean_with_transience( return wraprec; } - if (is_instrumentation_set(wraprec->special_instrumentation_before, - before_callback)) { + if (is_instrumentation_set_and_not_equal(wraprec->special_instrumentation_before, + before_callback)) { nrl_verbosedebug(NRL_INSTRUMENT, "%s: attempting to set special_instrumentation_before " "for %.*s, but " @@ -45,8 +45,8 @@ nruserfn_t* nr_php_wrap_user_function_before_after_clean_with_transience( return wraprec; } - if (is_instrumentation_set(wraprec->special_instrumentation_clean, - clean_callback)) { + if (is_instrumentation_set_and_not_equal(wraprec->special_instrumentation_clean, + clean_callback)) { nrl_verbosedebug(NRL_INSTRUMENT, "%s: attempting to set special_instrumentation_clean " "for %.*s, but " diff --git a/agent/php_wrapper.h b/agent/php_wrapper.h index 06e5c8e08..5e109efcd 100644 --- a/agent/php_wrapper.h +++ b/agent/php_wrapper.h @@ -327,8 +327,9 @@ extern zval** nr_php_get_return_value_ptr(TSRMLS_D); was_executed = 1; \ } -static inline bool is_instrumentation_set(nrspecialfn_t instrumentation, - nrspecialfn_t callback) { +static inline bool is_instrumentation_set_and_not_equal( + nrspecialfn_t instrumentation, + nrspecialfn_t callback) { if ((NULL != instrumentation) && (callback != instrumentation)) { return true; }