From 37ba5a5cc129e4c1849d818e53587c274e516add Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 7 Sep 2023 09:04:02 -0700 Subject: [PATCH] convert missed for loop (#1136) clang-tidy missed it as the declaration is outside of the loop. Signed-off-by: Rosen Penev --- taglib/ogg/oggfile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/taglib/ogg/oggfile.cpp b/taglib/ogg/oggfile.cpp index 9d06c04f..e36b355f 100644 --- a/taglib/ogg/oggfile.cpp +++ b/taglib/ogg/oggfile.cpp @@ -33,6 +33,8 @@ #include "oggpage.h" #include "oggpageheader.h" +#include + using namespace TagLib; namespace @@ -158,9 +160,8 @@ bool Ogg::File::save() return false; } - Map::ConstIterator it; - for(it = d->dirtyPackets.cbegin(); it != d->dirtyPackets.cend(); ++it) - writePacket(it->first, it->second); + for(const auto &[i, packet] : std::as_const(d->dirtyPackets)) + writePacket(i, packet); d->dirtyPackets.clear();