mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Move swap to assignment in builtin function
This commit is contained in:
parent
9bf6888aa8
commit
b8fa19b52d
1 changed files with 2 additions and 1 deletions
|
@ -1326,8 +1326,9 @@ static int luauF_byteswap(lua_State* L, StkId res, TValue* arg0, int nresults, S
|
||||||
double a1 = nvalue(arg0);
|
double a1 = nvalue(arg0);
|
||||||
unsigned n;
|
unsigned n;
|
||||||
luai_num2unsigned(n, a1);
|
luai_num2unsigned(n, a1);
|
||||||
|
n = (n << 24) | ((n << 8) & 0xff0000) | (n >> 8 & 0xff00) | n >> 24;
|
||||||
|
|
||||||
setnvalue(res, double(((n >> 24) & 0xff) | ((n << 8) & 0xff0000) | ((n >> 8) & 0xff00) | ((n << 24) & 0xff000000)));
|
setnvalue(res, double(n));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue