about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-31T13·34+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-31T13·34+0200
commitc368e079ca27195aa7dbed1e834479ab17ccae73 (patch)
treeb9ac4dc6606ac829b6ded4f61532fd3cb48fd0b5 /src
parent44f3f8048fdc2564f25389ec2c613880763bbd03 (diff)
resolve-system-dependencies: Simplify
Diffstat (limited to 'src')
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc
index b04595732b92..aadfdc9476b9 100644
--- a/src/resolve-system-dependencies/resolve-system-dependencies.cc
+++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc
@@ -28,15 +28,6 @@ std::set<string> readCacheFile(const Path & file)
     return tokenizeString<set<string>>(readFile(file), "\n");
 }
 
-void writeCacheFile(const Path & file, std::set<string> & deps)
-{
-    std::ofstream fp;
-    fp.open(file);
-    for (auto & d : deps)
-        fp << d << "\n";
-    fp.close();
-}
-
 std::string findDylibName(bool should_swap, ptrdiff_t dylib_command_start)
 {
     struct dylib_command *dylc = (struct dylib_command*)dylib_command_start;
@@ -167,7 +158,7 @@ std::set<string> getPath(const Path & path)
     for (auto & t : resolveTree(nextPath, deps))
         paths.insert(t);
 
-    writeCacheFile(cacheFile, paths);
+    writeFile(cacheFile, concatStringsSep("\n", paths));
 
     return paths;
 }