removed redundant get() calls

This commit is contained in:
Jack Andersen 2015-08-05 11:45:25 -10:00
parent ebb5c0743d
commit 28ed4ba6af
4 changed files with 13 additions and 13 deletions

View File

@ -227,11 +227,11 @@ protected:
std::vector<std::unique_ptr<IPartition>> m_partitions; std::vector<std::unique_ptr<IPartition>> m_partitions;
public: public:
DiscBase(std::unique_ptr<IDiscIO>&& dio) DiscBase(std::unique_ptr<IDiscIO>&& dio)
: m_discIO(std::move(dio)), m_header(*m_discIO.get()) {} : m_discIO(std::move(dio)), m_header(*m_discIO) {}
virtual bool commit()=0; virtual bool commit()=0;
inline const Header& getHeader() const {return m_header;} inline const Header& getHeader() const {return m_header;}
inline const IDiscIO& getDiscIO() const {return *m_discIO.get();} inline const IDiscIO& getDiscIO() const {return *m_discIO;}
inline IPartition* getDataPartition() inline IPartition* getDataPartition()
{ {
for (const std::unique_ptr<IPartition>& part : m_partitions) for (const std::unique_ptr<IPartition>& part : m_partitions)

View File

@ -79,7 +79,7 @@ bool DiscBase::IPartition::Node::extractToDirectory(const SystemString& basePath
{ {
std::unique_ptr<IPartReadStream> rs = beginReadStream(); std::unique_ptr<IPartReadStream> rs = beginReadStream();
std::unique_ptr<IFileIO::IWriteStream> ws = NewFileIO(path)->beginWriteStream(); std::unique_ptr<IFileIO::IWriteStream> ws = NewFileIO(path)->beginWriteStream();
ws->copyFromDisc(*rs.get(), m_discLength); ws->copyFromDisc(*rs, m_discLength);
} }
} }
return true; return true;

View File

@ -22,11 +22,11 @@ public:
m_apploaderSz = 32 + SBig(vals[0]) + SBig(vals[1]); m_apploaderSz = 32 + SBig(vals[0]) + SBig(vals[1]);
/* Yay files!! */ /* Yay files!! */
parseFST(*s.get()); parseFST(*s);
/* Also make DOL header and size handy */ /* Also make DOL header and size handy */
s->seek(m_dolOff); s->seek(m_dolOff);
parseDOL(*s.get()); parseDOL(*s);
} }
class PartReadStream : public IPartReadStream class PartReadStream : public IPartReadStream

View File

@ -195,7 +195,7 @@ public:
: IPartition(parent, kind, offset) : IPartition(parent, kind, offset)
{ {
std::unique_ptr<IDiscIO::IReadStream> s = parent.getDiscIO().beginReadStream(offset); std::unique_ptr<IDiscIO::IReadStream> s = parent.getDiscIO().beginReadStream(offset);
m_ticket.read(*s.get()); m_ticket.read(*s);
uint32_t tmdSize; uint32_t tmdSize;
s->read(&tmdSize, 4); s->read(&tmdSize, 4);
@ -224,12 +224,12 @@ public:
dataSize = SBig(dataSize) << 2; dataSize = SBig(dataSize) << 2;
s->seek(offset + tmdOff); s->seek(offset + tmdOff);
m_tmd.read(*s.get()); m_tmd.read(*s);
s->seek(offset + certChainOff); s->seek(offset + certChainOff);
m_caCert.read(*s.get()); m_caCert.read(*s);
m_tmdCert.read(*s.get()); m_tmdCert.read(*s);
m_ticketCert.read(*s.get()); m_ticketCert.read(*s);
/* Decrypt title key */ /* Decrypt title key */
std::unique_ptr<IAES> aes = NewAES(); std::unique_ptr<IAES> aes = NewAES();
@ -250,11 +250,11 @@ public:
m_apploaderSz = 32 + SBig(vals[0]) + SBig(vals[1]); m_apploaderSz = 32 + SBig(vals[0]) + SBig(vals[1]);
/* Yay files!! */ /* Yay files!! */
parseFST(*ds.get()); parseFST(*ds);
/* Also make DOL header and size handy */ /* Also make DOL header and size handy */
ds->seek(m_dolOff); ds->seek(m_dolOff);
parseDOL(*ds.get()); parseDOL(*ds);
} }
class PartReadStream : public IPartReadStream class PartReadStream : public IPartReadStream
@ -373,7 +373,7 @@ DiscWii::DiscWii(std::unique_ptr<IDiscIO>&& dio)
parts[p].partType = (Part::Type)SBig(parts[p].partType); parts[p].partType = (Part::Type)SBig(parts[p].partType);
} }
} }
} partInfo(*m_discIO.get()); } partInfo(*m_discIO);
/* Iterate for data partition */ /* Iterate for data partition */
m_partitions.reserve(partInfo.partCount); m_partitions.reserve(partInfo.partCount);