File tree 1 file changed +3
-6
lines changed 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -355,12 +355,9 @@ PHP_DOM_EXPORT void php_dom_reconcile_attribute_namespace_after_insertion(xmlAtt
355
355
static zend_always_inline zend_long dom_mangle_pointer_for_key (void * ptr )
356
356
{
357
357
zend_ulong value = (zend_ulong ) (uintptr_t ) ptr ;
358
- /* Shift 3/4 for better hash distribution because the low 3/4 bits are always 0. */
359
- #if SIZEOF_ZEND_LONG == 8
360
- return value >> 4 ;
361
- #else
362
- return value >> 3 ;
363
- #endif
358
+ /* Rotate 3/4 bits for better hash distribution because the low 3/4 bits are normally 0. */
359
+ const size_t rol_amount = (SIZEOF_ZEND_LONG == 8 ) ? 4 : 3 ;
360
+ return (value >> rol_amount ) | (value << (sizeof (value ) * 8 - rol_amount ));
364
361
}
365
362
366
363
static zend_always_inline void php_dom_libxml_reconcile_modern_single_node (dom_libxml_reconcile_ctx * ctx , xmlNodePtr node )
You can’t perform that action at this time.
0 commit comments