X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fdecodetrace.cpp;h=30d1667c5744073f310e7c4001aecfb5b90ce5aa;hb=8c0302f5df5182c0d3531d511416b5c9b1ea8e89;hp=f2aadd1b18ff3c7e4b8904a53aeef1b8f7c8d0a9;hpb=eee89ff865c28854eebdcecbe344f225b9ee366f;p=pulseview.git diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index f2aadd1..30d1667 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -431,14 +431,10 @@ void DecodeTrace::draw_annotation_block( // Check if all annotations are of the same type (i.e. we can use one color) // or if we should use a neutral color (i.e. gray) - bool single_format = true; - int format = annotations.front().format(); - - for (const Annotation &a : annotations) - if (a.format() != format) { - single_format = false; - break; - } + const int format = annotations.front().format(); + const bool single_format = std::all_of( + annotations.begin(), annotations.end(), + [&](const Annotation &a) { return a.format() == format; }); p.setPen((single_format ? OutlineColours[colour] : Qt::gray)); p.setBrush(QBrush((single_format ? Colours[colour] : Qt::gray),