SessionSerializer: Use std::unique_ptr instead of std::shared_ptr

pull/287/head
Tatsuhiro Tsujikawa 2014-09-15 16:43:46 +09:00
parent 306d92a1da
commit b63c1dce08
1 changed files with 3 additions and 3 deletions

View File

@ -74,15 +74,15 @@ bool SessionSerializer::save(const std::string& filename) const
std::string tempFilename = filename;
tempFilename += "__temp";
{
std::shared_ptr<IOFile> fp;
std::unique_ptr<IOFile> fp;
#if HAVE_ZLIB
if (util::endsWith(filename, ".gz")) {
fp = std::make_shared<GZipFile>(tempFilename.c_str(), IOFile::WRITE);
fp = make_unique<GZipFile>(tempFilename.c_str(), IOFile::WRITE);
}
else
#endif
{
fp = std::make_shared<BufferedFile>(tempFilename.c_str(), IOFile::WRITE);
fp = make_unique<BufferedFile>(tempFilename.c_str(), IOFile::WRITE);
}
if(!*fp) {
return false;