Skip to content

Commit

Permalink
Handle case when stripped comments are the same
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Jan 21, 2025
1 parent e486aa4 commit befcabf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/VlcSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class VlcSourceCount final {
// TYPES
struct PointCmp {
bool operator()(const VlcPoint* a, const VlcPoint* b) const {
return a->commentStripped() < b->commentStripped();
const std::string aStripped = a->commentStripped();
const std::string bStripped = b->commentStripped();
// operands of nested condition operators may have the same commentStripped()
return aStripped < bStripped || ((aStripped == bStripped) && a < b);
}
};
using PointsSet = std::set<VlcPoint*, PointCmp>;
Expand Down

0 comments on commit befcabf

Please sign in to comment.