Skip to content

Commit 9abafc3

Browse files
committed
for range
Signed-off-by: Rosen Penev <[email protected]>
1 parent 209a724 commit 9abafc3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: include/exiv2/value.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,8 @@ int ValueType<T>::read(const std::string& buf) {
15261526
template <typename T>
15271527
size_t ValueType<T>::copy(byte* buf, ByteOrder byteOrder) const {
15281528
size_t offset = 0;
1529-
for (auto i = value_.begin(); i != value_.end(); ++i) {
1530-
offset += toData(buf + offset, *i, byteOrder);
1529+
for (const auto& val : value_) {
1530+
offset += toData(buf + offset, val, byteOrder);
15311531
}
15321532
return offset;
15331533
}

Diff for: src/iptc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ const char* IptcData::detectCharset() const {
313313
bool ascii = true;
314314
bool utf8 = true;
315315

316-
for (pos = begin(); pos != end(); ++pos) {
317-
std::string value = pos->toString();
318-
if (pos->value().ok()) {
316+
for (const auto& key : *this) {
317+
std::string value = key.toString();
318+
if (key.value().ok()) {
319319
int seqCount = 0;
320320
for (auto c : value) {
321321
if (seqCount) {

0 commit comments

Comments
 (0)