ソースを参照

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

Tatsuhiro Tsujikawa 11 年 前
コミット
b63c1dce08
1 ファイル変更3 行追加3 行削除
  1. 3 3
      src/SessionSerializer.cc

+ 3 - 3
src/SessionSerializer.cc

@@ -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;