- 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; });