]> granicus.if.org Git - taglib/commitdiff
Remove some redundant code.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Sat, 21 Jan 2017 15:43:32 +0000 (00:43 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Sat, 21 Jan 2017 15:43:32 +0000 (00:43 +0900)
TagUnion::access() does the same thing as FLAC::File::ID3v2Tag().

taglib/flac/flacfile.cpp

index 34599e89d004d38ff230d7a867b3d5933923146d..b6b72960d43ddc81f8578ad85c07baf4ee4c187d 100644 (file)
@@ -297,11 +297,7 @@ bool FLAC::File::save()
 
 ID3v2::Tag *FLAC::File::ID3v2Tag(bool create)
 {
-  if(!create || d->tag[FlacID3v2Index])
-    return static_cast<ID3v2::Tag *>(d->tag[FlacID3v2Index]);
-
-  d->tag.set(FlacID3v2Index, new ID3v2::Tag());
-  return static_cast<ID3v2::Tag *>(d->tag[FlacID3v2Index]);
+  return d->tag.access<ID3v2::Tag>(FlacID3v2Index, create);
 }
 
 ID3v1::Tag *FLAC::File::ID3v1Tag(bool create)