Rust sort_unstable_by with more complex closure unexpectedly shrunk binary
Rust排序闭包加了个if语句,二进制体积反而变小1KB,探究编译器优化背后的意外之喜。
Thing I stumbled upon: I added boolean argument and if statement inside sort_unstable_by closure: ``` //from |&a, &b| compare(a, b) //to |&…