manual range loop conversions (#1126)

* manual range loop conversions

Signed-off-by: Rosen Penev <[email protected]>

* Restore const containers where non const temporaries are iterated

* Use std::as_const() instead of const container copies where possible

---------

Signed-off-by: Rosen Penev <[email protected]>
Co-authored-by: Urs Fleisch <[email protected]>
This commit is contained in:
Rosen Penev
2023-09-06 20:58:13 +02:00
committed by GitHub
co-authored by Urs Fleisch
parent 303b55fb97
commit 524b588a1e
37 changed files with 464 additions and 481 deletions
+3 -2
View File
@@ -38,6 +38,7 @@
#include "mp4file.h"
#include "tag.h"
#include <cstring>
#include <utility>
#include "id3v2framefactory.h"
#include "tpropertymap.h"
@@ -259,8 +260,8 @@ void taglib_tag_free_strings()
if(!stringManagementEnabled)
return;
for(auto it = strings.cbegin(); it != strings.cend(); ++it)
free(*it);
for(auto &string : std::as_const(strings))
free(string);
strings.clear();
}