lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 21 Nov 2020, at 19:11, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

anyway, usage of lua_pushlstring instead of lua_pushstring is much better.

It depends on what you call "better". For literal strings,
lua_pushstring is both simpler to use and faster. For mutable
strings, lua_pushstring may not be even correct. (The string
might contain embedded zeros.)

yep, it’s first thing being better. the 2nd one - usually I know the string length and can’t see any reason to compute it once again.

-- 
Yours sincerely, Eugeny.
+33 6 38 52 27 93