clang-tidy: range for loop conversions

Found with modernize-loop-convert

Ran through git clang-format.

Also removed several questionable loops and replaced with simpler
algorithms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-04-26 17:01:09 -07:00
committed by Luis Díaz Más
parent 5a4c3cd057
commit 4ceb325c8f
35 changed files with 406 additions and 438 deletions
+5 -9
View File
@@ -45,17 +45,13 @@ try {
Exiv2::PreviewManager loader(*image);
Exiv2::PreviewPropertiesList list = loader.getPreviewProperties();
for (Exiv2::PreviewPropertiesList::iterator pos = list.begin(); pos != list.end(); pos++) {
std::cout << pos->mimeType_
<< " preview, type " << pos->id_ << ", "
<< pos->size_ << " bytes, "
<< pos->width_ << 'x' << pos->height_ << " pixels"
for (auto&& pos : list) {
std::cout << pos.mimeType_ << " preview, type " << pos.id_ << ", " << pos.size_ << " bytes, " << pos.width_
<< 'x' << pos.height_ << " pixels"
<< "\n";
Exiv2::PreviewImage preview = loader.getPreviewImage(*pos);
preview.writeFile(filename + "_"
+ Exiv2::toString(pos->width_) + "x"
+ Exiv2::toString(pos->height_));
Exiv2::PreviewImage preview = loader.getPreviewImage(pos);
preview.writeFile(filename + "_" + Exiv2::toString(pos.width_) + "x" + Exiv2::toString(pos.height_));
}
// Cleanup