Minor optimizations

See also
http://stackoverflow.com/questions/20364848/is-partial-sort-copy-the-fas
test-c-partial-sort