Просмотр исходного кода

waste less time in mkdirp

master
Martin Dørum 5 лет назад
Родитель
Сommit
287078ff30
1 измененных файлов: 6 добавлений и 0 удалений
  1. 6
    0
      src/sys.cc

+ 6
- 0
src/sys.cc Просмотреть файл

@@ -11,6 +11,7 @@
#include <sys/wait.h>
#include <stdexcept>
#include <system_error>
#include <unordered_set>

#include "logger.h"
#include "globals.h"
@@ -45,6 +46,11 @@ bool fileExists(const std::string &path) {
}

void mkdirp(const std::string &path) {
static thread_local std::unordered_set<std::string> set;
auto res = set.emplace(path);
if (!res.second)
return;

// TODO: Implement this in C++ instead
std::vector<std::string> argv;
argv.push_back("mkdir");

Загрузка…
Отмена
Сохранить