local function pairs(tbl)
return next, tbl, nil
end
There won’t be much difference here.
However, if you’re iterating through arrays then I’d recommend using ipairs as recently in the new VM it has been optimised & it promises ordered iteration.
The new compiler employs idiomatic optimizations so that for i, v in pairs is no longer its equivalent function call wrapper, so it’s not exactly the same anymore, but since next has also been added to the list of optimizations they’ll still be about the same speed.
While pairs will work, ipairs is intended for arrays and will likely run a bit faster in those cases. Iteration order is also not necessarily predictable when using pairs/next, while ipairs will always start at 1 and stop at the first nil/hole in the array.