Skip to content

Commit 18a385f

Browse files
committed
Use ZEND_BYTES_SWAP32() for php_pack_reverse_int32()
1 parent 836cda6 commit 18a385f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ext/standard/pack.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ ZEND_ATTRIBUTE_CONST static inline uint16_t php_pack_reverse_int16(uint16_t arg)
7676
/* {{{ php_pack_reverse_int32 */
7777
ZEND_ATTRIBUTE_CONST static inline uint32_t php_pack_reverse_int32(uint32_t arg)
7878
{
79-
uint32_t result;
80-
result = ((arg & 0xFF) << 24) | ((arg & 0xFF00) << 8) | ((arg >> 8) & 0xFF00) | ((arg >> 24) & 0xFF);
81-
82-
return result;
79+
return ZEND_BYTES_SWAP32(arg);
8380
}
8481
/* }}} */
8582

0 commit comments

Comments
 (0)