This commit is contained in:
dcode
2019-03-13 22:35:47 +01:00
parent 6f70826e45
commit e38f627c8b
10 changed files with 326 additions and 276 deletions

View File

@ -25,8 +25,7 @@ export function bswap<T>(value: T): T {
return value;
}
@inline
export function bswap16<T>(value: T): T {
@inline export function bswap16<T>(value: T): T {
if (isInteger<T>() && sizeof<T>() <= 4) {
if (sizeof<T>() == 2) {
return <T>((value << 8) | ((value >> 8) & <T>0x00FF));