Order the returned list of `CangjieChar`
Currently, the cangjie_get_characters()
function returns a completely unordered list of CangjieChar
, and it is up to the application using libcangjie to order them all afterwards.
This means that we iterate over the list of characters twice:
- once when creating the list of
CangjieChar
(we iterate over the results of the SQL query) - once when ordering them (in the application using libcangjie)
If cangjie_get_characters()
ordered the results itself, it could do so with an ORDER BY
statement directly in the SQL query, and so we'd remove the need for the application to do it themselves.
The new API should let the application specify on which column(s) to order, ascending or descending.