Skip to content

Commit

Permalink
addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Apr 17, 2024
1 parent c13bef4 commit 16d7326
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/eckit/io/PooledFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@
* does it submit to any jurisdiction.
*/

#include "eckit/io/PooledFile.h"

#include <cstdio>
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include <sstream>
#include <utility>

#include "eckit/config/LibEcKit.h"
#include "eckit/config/Resource.h"
#include "eckit/exception/Exceptions.h"
#include "eckit/filesystem/PathName.h"
#include "eckit/io/Buffer.h"
#include "eckit/io/PooledFile.h"
#include "eckit/log/Bytes.h"

namespace eckit {
Expand Down Expand Up @@ -282,7 +286,7 @@ eckit::PoolFileEntry* Pool::get(const eckit::PathName& name) {
std::lock_guard<std::mutex> lock(filePoolMutex_);
auto j = filePool_.find(name);
if (j == filePool_.end()) {
filePool_.emplace(std::make_pair(name, std::unique_ptr<eckit::PoolFileEntry>(new eckit::PoolFileEntry(name))));
filePool_.emplace(name, new eckit::PoolFileEntry(name));
j = filePool_.find(name);
}
return (*j).second.get();
Expand Down

0 comments on commit 16d7326

Please sign in to comment.