Skip to content

Commit 5be42f1

Browse files
committed
try to fix some fanalyzer warnings
Signed-off-by: Rosen Penev <[email protected]>
1 parent c0083d6 commit 5be42f1

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

src/convert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ std::string Converter::computeExifDigest(bool tiff) {
12841284
}
12851285
#else
12861286
std::string Converter::computeExifDigest(bool) {
1287-
return std::string("");
1287+
return {};
12881288
}
12891289
#endif
12901290

src/pngchunk_int.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,31 +318,25 @@ void PngChunk::parseChunkContent(Image* pImage, const byte* key, size_t keySize,
318318
} // PngChunk::parseChunkContent
319319

320320
std::string PngChunk::makeMetadataChunk(const std::string& metadata, MetadataId type) {
321-
std::string chunk;
322321
std::string rawProfile;
323322

324323
switch (type) {
325324
case mdComment:
326-
chunk = makeUtf8TxtChunk("Description", metadata, true);
327-
break;
325+
return makeUtf8TxtChunk("Description", metadata, true);
328326
case mdExif:
329327
rawProfile = writeRawProfile(metadata, "exif");
330-
chunk = makeAsciiTxtChunk("Raw profile type exif", rawProfile, true);
331-
break;
328+
return makeAsciiTxtChunk("Raw profile type exif", rawProfile, true);
332329
case mdIptc:
333330
rawProfile = writeRawProfile(metadata, "iptc");
334-
chunk = makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
335-
break;
331+
return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
336332
case mdXmp:
337-
chunk = makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
338-
break;
333+
return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
339334
case mdIccProfile:
340-
break;
341335
case mdNone:
342-
break;
336+
return {};
343337
}
344338

345-
return chunk;
339+
return {};
346340

347341
} // PngChunk::makeMetadataChunk
348342

src/tags.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ std::string ExifKey::tagLabel() const {
302302

303303
std::string ExifKey::tagDesc() const {
304304
if (!p_->tagInfo_ || p_->tagInfo_->tag_ == 0xffff)
305-
return "";
305+
return {};
306306
return _(p_->tagInfo_->desc_);
307307
}
308308

0 commit comments

Comments
 (0)