Skip to content

Commit 0a83aa1

Browse files
committed
review: optimize class string comparison
1 parent faefa68 commit 0a83aa1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

agent/fw_drupal8.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,9 @@ static bool nr_drupal_hook_attribute_instrument(zval* module_handler) {
673673
}
674674

675675
if (0
676-
== nr_stricmp(ZEND_STRING_VALUE(class_key),
677-
"Drupal\\Core\\Extension\\ProceduralCall")) {
676+
== nr_striendswith(
677+
ZEND_STRING_VALUE(class_key), ZEND_STRING_LEN(class_key),
678+
NR_PSTR("Drupal\\Core\\Extension\\ProceduralCall"))) {
678679
hookpath = nr_formatf("%s", ZEND_STRING_VALUE(method_key));
679680
} else {
680681
hookpath = nr_formatf("%s::%s", ZEND_STRING_VALUE(class_key),

0 commit comments

Comments
 (0)