Skip to content

Commit d3fb424

Browse files
committed
Remove MyMutex and MyLock
1 parent 5231eaa commit d3fb424

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

simplecpp.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,10 +2408,6 @@ namespace simplecpp {
24082408
}
24092409

24102410
#ifdef SIMPLECPP_WINDOWS
2411-
using MyMutex = std::mutex;
2412-
template<class T>
2413-
using MyLock = std::lock_guard<T>;
2414-
24152411
static bool isAbsolutePath(const std::string &path)
24162412
{
24172413
if (path.length() >= 3 && path[0] > 0 && std::isalpha(path[0]) && path[1] == ':' && (path[2] == '\\' || path[2] == '/'))
@@ -3004,23 +3000,23 @@ class NonExistingFilesCache {
30043000
NonExistingFilesCache() {}
30053001

30063002
bool contains(const std::string& path) {
3007-
MyLock<MyMutex> lock(m_mutex);
3003+
std::lock_guard<std::mutex> lock(m_mutex);
30083004
return (m_pathSet.find(path) != m_pathSet.end());
30093005
}
30103006

30113007
void add(const std::string& path) {
3012-
MyLock<MyMutex> lock(m_mutex);
3008+
std::lock_guard<std::mutex> lock(m_mutex);
30133009
m_pathSet.insert(path);
30143010
}
30153011

30163012
void clear() {
3017-
MyLock<MyMutex> lock(m_mutex);
3013+
std::lock_guard<std::mutex> lock(m_mutex);
30183014
m_pathSet.clear();
30193015
}
30203016

30213017
private:
30223018
std::set<std::string> m_pathSet;
3023-
MyMutex m_mutex;
3019+
std::mutex m_mutex;
30243020
};
30253021

30263022
static NonExistingFilesCache nonExistingFilesCache;

0 commit comments

Comments
 (0)