Quote:
Originally Posted by BetterRed
Good to know the sorting is done at the end, otherwise my faith in kiwidudes good sense would have been called into question.
Curious: Why would you you expect sorting a collection of ints to be slower than sorting a collection of char arrays 
|
It isn't sorting just by an integer. The sort code is:
Code:
if by_title:
skeys = sorted(candidates_map.keys())
else:
skeys = sorted(candidates_map.keys(),
key=lambda ckey: '%04d%s' % (len(candidates_map[ckey]), ckey),
reverse=True)
So, get the count of duplicates books for a title, convert to string and combine with the title. That will be slower for a lot of duplicates, but I'm not sure how noticeable it would be.