From 1c3e3740439f9304c7fe75567267bec2d0577267 Mon Sep 17 00:00:00 2001 From: Amber Sistla Date: Wed, 8 Jan 2025 15:29:27 -0700 Subject: [PATCH] fix(agent): use optimization for class entry length --- agent/lib_aws_sdk_php.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/agent/lib_aws_sdk_php.c b/agent/lib_aws_sdk_php.c index 7b125e741..bf2b26726 100644 --- a/agent/lib_aws_sdk_php.c +++ b/agent/lib_aws_sdk_php.c @@ -372,14 +372,16 @@ NR_PHP_WRAPPER(nr_aws_client_call) { char* command_name_string = NULL; char* real_class_and_command = NULL; nr_segment_t* segment = NULL; + zend_class_entry* class_entry = NULL; - klass - = nr_php_class_entry_name(Z_OBJCE_P(nr_php_execute_scope(execute_data))); + class_entry = Z_OBJCE_P(nr_php_execute_scope(execute_data)); + klass = nr_php_class_entry_name(class_entry); command_name_string = nr_lib_aws_sdk_php_get_command_name(NR_EXECUTE_ORIG_ARGS); if (NULL != command_name_string && NULL != klass) { - if (nr_striendswith(klass, nr_strlen(klass), AWS_SDK_PHP_SQSCLIENT_CLASS, + if (nr_striendswith(klass, nr_php_class_entry_name_length(class_entry), + AWS_SDK_PHP_SQSCLIENT_CLASS, AWS_SDK_PHP_SQSCLIENT_CLASS_LEN)) { nr_lib_aws_sdk_php_sqs_handle(auto_segment, command_name_string, NR_EXECUTE_ORIG_ARGS);