mirror of
https://github.com/lua/lua
synced 2025-04-15 17:32:49 +03:00
avoid using 'luaS_new' when can use 'luaS_newlstr'
This commit is contained in:
parent
d00d2eaf51
commit
a08fc34ee4
6
lvm.c
6
lvm.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lvm.c,v 2.107 2010/03/26 20:58:11 roberto Exp roberto $
|
** $Id: lvm.c,v 2.108 2010/03/29 20:45:49 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -50,8 +50,8 @@ int luaV_tostring (lua_State *L, StkId obj) {
|
|||||||
else {
|
else {
|
||||||
char s[LUAI_MAXNUMBER2STR];
|
char s[LUAI_MAXNUMBER2STR];
|
||||||
lua_Number n = nvalue(obj);
|
lua_Number n = nvalue(obj);
|
||||||
lua_number2str(s, n);
|
int l = lua_number2str(s, n);
|
||||||
setsvalue2s(L, obj, luaS_new(L, s));
|
setsvalue2s(L, obj, luaS_newlstr(L, s, l));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user