diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-04-02 12:39:07 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-04-02 12:39:07 -0300 |
| commit | a08fc34ee4f17f9a66bbb96b1cb2dcde00c7e179 (patch) | |
| tree | 1c44b09ab2c7aa5adad64a8aab867dbd1e67697d | |
| parent | d00d2eaf51ffd07caa172d6e9fc3c796fd086403 (diff) | |
| download | lua-a08fc34ee4f17f9a66bbb96b1cb2dcde00c7e179.tar.gz lua-a08fc34ee4f17f9a66bbb96b1cb2dcde00c7e179.tar.bz2 lua-a08fc34ee4f17f9a66bbb96b1cb2dcde00c7e179.zip | |
avoid using 'luaS_new' when can use 'luaS_newlstr'
| -rw-r--r-- | lvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.107 2010/03/26 20:58:11 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.108 2010/03/29 20:45:49 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -50,8 +50,8 @@ int luaV_tostring (lua_State *L, StkId obj) { | |||
| 50 | else { | 50 | else { |
| 51 | char s[LUAI_MAXNUMBER2STR]; | 51 | char s[LUAI_MAXNUMBER2STR]; |
| 52 | lua_Number n = nvalue(obj); | 52 | lua_Number n = nvalue(obj); |
| 53 | lua_number2str(s, n); | 53 | int l = lua_number2str(s, n); |
| 54 | setsvalue2s(L, obj, luaS_new(L, s)); | 54 | setsvalue2s(L, obj, luaS_newlstr(L, s, l)); |
| 55 | return 1; | 55 | return 1; |
| 56 | } | 56 | } |
| 57 | } | 57 | } |
