Skip to content

Commit

Permalink
chore: rename function to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
ZNeumann committed Aug 3, 2023
1 parent f521b41 commit fa05f1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions agent/php_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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 "
Expand All @@ -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 "
Expand Down
5 changes: 3 additions & 2 deletions agent/php_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fa05f1b

Please sign in to comment.