[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: String tokenization function
- From: Matthew Wild <mwild1@...>
- Date: Sat, 7 Nov 2015 15:46:41 +0000
On 7 November 2015 at 14:42, Marco Atzori <email@example.com> wrote:
> I created various functions for string manipulation in Lua, where the
> strings are composed of tokens separated by an ASCII character (which may be
> the point, comma, semicolon etc.). Two of these are the functions numtok()
> and gettok(). Here is the code: http://nopaste.linux-dev.org/?824658
This code is really complex and inefficient. Are there reasons you are
doing it like this? Why can't you use tables?
If you have actual constraints, revealing them might allow people to
help you better. If you don't have any constraints and just want it to
perform well, then there are some really much simpler and more
efficient solutions than your implementation.