In util.lua you have two functions to iterate in a sorted order about key,value tables:
orderedPairs(t) (copy paste from lua website) and sorted_pairs(t,fn).
I assume that they should do the same, except sorted_pairs can handle a custom sorting function.
But currently sorted_pairs(t,fn) is not working. When you give it a table like {b=10,a=40,c=50} it should sort it by key, so alphabetically. But instead you will receive 1,2,3 as keys and a,b,c as values. Is this what it is supposed to do? I doubt it.
Steps to Reproduce
test your sorted_pairs function in util.lua and see if it does behave like expected.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now