Skip to content

Commit bfb53aa

Browse files
committed
ai min: MT_Sem, UniSmartLog UniCoutLog
1 parent cde3445 commit bfb53aa

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

src/log/UniBaseLog.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <chrono>
1313
#include <cstdio>
1414
#include <ctime>
15-
#include <memory>
1615
#include <string>
1716
#include <thread>
1817

src/log/UniCoutLog.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
// ***********************************************************************************************
2020
#pragma once
2121

22-
#include <memory>
2322
#include <iostream>
2423

2524
#include "UniBaseLog.hpp"

src/log/UniSmartLog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ namespace rlib
1414
UniSmartLog::UniSmartLog(const LogName& aUniLogName) noexcept : uniLogName_(aUniLogName)
1515
{
1616
// for(auto&& name_log : name_log_S_) cout << name_log.first<<", p=" << name_log.second.get() << endl;
17-
auto&& name_log = name_log_S_.find(aUniLogName);
18-
if (name_log == name_log_S_.end())
17+
auto [name_log, insertNew] = name_log_S_.try_emplace(aUniLogName);
18+
if (insertNew)
1919
{
2020
smartLog_ = make_shared<SmartLog>();
21-
name_log_S_[aUniLogName] = smartLog_;
21+
name_log->second = smartLog_;
2222
HID("creatd new log=" << (void*)(smartLog_.get()) << ", name=" << aUniLogName << ", nLog=" << nLog());
2323
}
2424
else

src/thread/MT_Semaphore.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ void MT_Semaphore::timedwait(const size_t aSec, const size_t aRestNsec) noexcept
4343
// impossible since MT_Semaphore's constructor
4444
// else if (errno == EINVAL) // avoid dead loop
4545
// return;
46-
47-
continue; // restart for EINTR
4846
} // for
4947
}
5048

0 commit comments

Comments
 (0)