[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lookup table with integer keys
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 6 Mar 2014 09:38:42 +0200
2014-03-06 9:30 GMT+02:00 <dehmel.r@atg-lm.com>:
> is the usage of a lookup table with keys from 0 to n less efficient compared
> to 1 to n+1?
Only the index 0 itself, which always is in the "hash" part.
> Or in other words:
> Shoud I change a lookup table in C
>
> v = tab[k]; // with k = 0 to n
> in lua to
> v = tab[k+1]
The possibilities for error are so great that I never do that.