pa_database_next() is inefficient for the "simple" pa_database implementation
Submitted by Tanu Kaskinen
Assigned to pul..@..op.org
If I want to iterate through a database with pa_database_next(), it will have O(n*n) time complexity with the "simple" pa_database implementation, because pa_database_next() will every time search for the next item by iterating the backing pa_hashmap from the beginning.
I'm not sure what would be the best way to fix this. Maybe the pa_database iteration interface could be changed to match pa_hashmap_iterate()?
In normal use cases I don't see this inefficiency causing any trouble, because the databases don't tend to be very big. It's just annoying to have this kind of stuff in the code...