Skip to content

Commit e40fa98

Browse files
authored
Simplify bswap_16 implementation
Simplify bswap_16 implementation on platforms which don't already have it defined. This has no effect on the generated assembly; it just simplifies the source code.
1 parent 3f726c9 commit e40fa98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compat/byteswap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#if HAVE_DECL_BSWAP_16 == 0
3636
inline uint16_t bswap_16(uint16_t x)
3737
{
38-
return (x >> 8) | ((x & 0x00ff) << 8);
38+
return (x >> 8) | (x << 8);
3939
}
4040
#endif // HAVE_DECL_BSWAP16
4141

0 commit comments

Comments
 (0)