[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: oops, was strings with length 0 "disappear" in table
- From: Bas Groothedde <lua@...>
- Date: Thu, 08 Dec 2011 13:35:21 +0100
Internally, Lua adds an extra zero byte at the end of any string (so
also for the empty string), but this is only to simplify interfacing
with C host code. Lua by itself never use that zero terminating byte
nor count it in the length ; it stores the length of a string together
with the pointer and the hash value.
I was more or less insinuating that even without data, an empty string
isn't really weird at all.