Pass parameters to MessageSorter comparison functions by value instead of by reference