use ION_STRING_EQUALS API
authorMichael Wallner <mike@php.net>
Tue, 21 Dec 2021 07:33:23 +0000 (08:33 +0100)
committerMichael Wallner <mike@php.net>
Tue, 21 Dec 2021 07:33:23 +0000 (08:33 +0100)
ion_private.h

index 5264b0b0a02309c37a8ad8a1619c5fddce74fff0..6dc21d409e4adb34f227478584917ee8add810d8 100644 (file)
@@ -2106,10 +2106,8 @@ static inline void php_ion_unserialize_annotations(php_ion_unserializer *ser)
                ION_CHECK(ion_reader_get_an_annotation(ser->reader, i, &ann_str));
 
                if (ann_str.length != 1) {
-                       if (ann_str.length == ION_SYS_STRLEN_SHARED_SYMBOL_TABLE) {
-                               if (!memcmp(ann_str.value, ION_SYMBOL_SHARED_SYMBOL_TABLE_BYTES, ION_SYS_STRLEN_SHARED_SYMBOL_TABLE)) {
-                                       ser->annotations.shared_symtab = true;
-                               }
+                       if (ION_STRING_EQUALS(&ann_str, &ION_SYMBOL_SHARED_SYMBOL_TABLE_STRING)) {
+                               ser->annotations.shared_symtab = true;
                        }
                        continue;
                }