[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal: improvement of string.gsub()
- From: Mike Pall <mikelu-0504@...>
- Date: Mon, 18 Apr 2005 12:34:29 +0200
Hi,
Goetz.Kluge@infineon.com wrote:
> Solution (in implementation of string.gsub): In case the replacement has
> the same size as the key word (which is to be replaced), the
> search&replace could be done directly in the original string without the
> need to create new strings. This would increase speed significantly and
> decrease memory usage.
Lua strings are immutable and shareable. You can't modify them in-place.
> Sorry for not implementing that myself, but unfortunately I cannot
> tackle this issue right now.
If you had tried, the compiler would have complained. Lua strings
are exported as 'const char *'.
Bye,
Mike