|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently this function takes a list, splits into two lists based on
whether or not a function returns None, sorts the list that isn't None,
and then appends the list of None to the end. This creates 4 new
concrete lists on each method call, requires the use of 3 filter +
lambda pairs, and calls list.sort(). Pretty complicated and inefficient.
This patch replaces that with a single sorted() function call with a kay
function that replaces None with a value that is guaranteed to sort less
than what Message.get_date() will return, but will not cause a
comparison to None (which is an error in Python 3.x). This is all based
on iterators and avoids the need for filter or list concatenation. This
should result in only one new list being created.
|