Skip to content

Commit 85cd015

Browse files
committed
Removed close() call from all file streams as the destructor does it automatically.
1 parent 0720422 commit 85cd015

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

src/app/application/application.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ void Application::ParseConfigFile(const std::string& ConfigFile) const
369369
std::ifstream ConfigFileFs(ConfigFile);
370370
boost::program_options::store(boost::program_options::parse_config_file(ConfigFileFs, *ConfigOptions), *Config);
371371
Config -> notify();
372-
ConfigFileFs.close();
373372
}
374373

375374
Application::Application(int argc, char** argv)

src/lib/zswapdebug/zswapdebug.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ T ZSwapDebug::ReadModuleDebugValue(const std::string& Name) const
8585
{
8686
std::ifstream ZSwapSysFs(FullPath);
8787
ZSwapSysFs >> Result;
88-
ZSwapSysFs.close();
8988
}
9089

9190
return Result;

src/lib/zswapobject/zswapobject.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ void ZSwapObject::WriteZSwapValue(const std::string& Name, const std::string& Va
4545
if (!std::filesystem::exists(FullPath)) throw std::runtime_error(std::format("Configuring the \"{0}\" variable is not possible on current kernel!", Name));
4646
std::ofstream ZSwapSysFs(FullPath);
4747
ZSwapSysFs << Value;
48-
ZSwapSysFs.close();
4948
}
5049

5150
std::string ZSwapObject::ReadZSwapValue(const std::string& Name) const
@@ -55,7 +54,6 @@ std::string ZSwapObject::ReadZSwapValue(const std::string& Name) const
5554
std::string Result;
5655
std::ifstream ZSwapSysFs(FullPath);
5756
ZSwapSysFs >> Result;
58-
ZSwapSysFs.close();
5957
return Result;
6058
}
6159

0 commit comments

Comments
 (0)