Skip to content

Commit 315ecbb

Browse files
committed
review: optimize class string comparison
1 parent 977e9ef commit 315ecbb

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
@@ -670,8 +670,9 @@ static bool nr_drupal_hook_attribute_instrument(zval* module_handler) {
670670
}
671671

672672
if (0
673-
== nr_stricmp(ZEND_STRING_VALUE(class_key),
674-
"Drupal\\Core\\Extension\\ProceduralCall")) {
673+
== nr_striendswith(
674+
ZEND_STRING_VALUE(class_key), ZEND_STRING_LEN(class_key),
675+
NR_PSTR("Drupal\\Core\\Extension\\ProceduralCall"))) {
675676
hookpath = nr_formatf("%s", ZEND_STRING_VALUE(method_key));
676677
} else {
677678
hookpath = nr_formatf("%s::%s", ZEND_STRING_VALUE(class_key),

0 commit comments

Comments
 (0)