On 3/2/15 8:52 AM, "Nordlöw" wrote:
On Friday, 27 February 2015 at 15:00:35 UTC, Steven Schveighoffer wrote:
Hm... what about:

return count < rhs.count ? -1 : count > rhs.count ? 1 : rank <
rhs.rank ? -1 : rank > rhs.rank;

Is this more efficient than my version?

You said "more compact", not more efficient :)

But I think they are probably the same generated code. I'm not doing anything really different (except for the shortcut for rank > rhs.rank being 1 or 0 based on the conversion to int).

-Steve

Reply via email to