[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue 4545: Use Grob::programming_error in Semi_tie:: and Tie::less
From: |
dak |
Subject: |
Re: Issue 4545: Use Grob::programming_error in Semi_tie:: and Tie::less (issue 259210043 by address@hidden) |
Date: |
Sat, 08 Aug 2015 17:05:40 +0000 |
https://codereview.appspot.com/259210043/diff/1/lily/semi-tie.cc
File lily/semi-tie.cc (right):
https://codereview.appspot.com/259210043/diff/1/lily/semi-tie.cc#newcode102
lily/semi-tie.cc:102: return false;
This may sound facetious and your code corresponds to the previous code,
but if you return false here, you can have both a < b and b < a which
may confuse some sorting algorithms. In the interest of causing minimal
followup damage, I'd return true for this (but not the previous) return
statement. This puts uncastable items at a defined place in sort order
(last) while not claiming a < a (because if both items are uncastable,
the first return statement will return false already).
https://codereview.appspot.com/259210043/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Issue 4545: Use Grob::programming_error in Semi_tie:: and Tie::less (issue 259210043 by address@hidden),
dak <=