From: Tsuda Kageyu <tsuda.kageyu@gmail.com> Date: Sat, 21 Jan 2017 15:43:32 +0000 (+0900) Subject: Remove some redundant code. X-Git-Tag: v1.12-beta-1~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc38a0e40131f649fba37e218da2d9598ef3a633;p=taglib Remove some redundant code. TagUnion::access() does the same thing as FLAC::File::ID3v2Tag(). --- diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index 34599e89..b6b72960 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -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)