8407ec9fed
Previously it would call: f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...)) (where s/of1 = 'self/other field 1', and f was std::cmp::lexical_ordering) This meant that every .cmp subcall got evaluated when calling a derived TotalOrd.cmp. This corrects this to use let test = sf1.cmp(&of1); if test == Equal { let test = sf2.cmp(&of2); if test == Equal { // ... } else { test } } else { test } This gives a lexical ordering by short-circuiting on the first comparison that is not Equal. |
||
---|---|---|
.. | ||
deriving | ||
tt | ||
asm.rs | ||
auto_encode.rs | ||
base.rs | ||
build.rs | ||
bytes.rs | ||
cfg.rs | ||
concat_idents.rs | ||
env.rs | ||
expand.rs | ||
fmt.rs | ||
log_syntax.rs | ||
quote.rs | ||
source_util.rs | ||
trace_macros.rs |