Although the syntax is different, both methods almost produce an identical result.
Neither requires hash lookups (or both do).
Lua starts indexes at 1 by default though, so your method is offset by one.