CONTEXT: use l_Frames as stack to reduce modification complexity

This commit is contained in:
Alexander A. Klimov 2022-10-28 16:56:29 +02:00
parent 70df0e298e
commit 0b46e0aeab
1 changed files with 3 additions and 3 deletions

View File

@ -10,12 +10,12 @@ static boost::thread_specific_ptr<std::vector<String>> l_Frames;
ContextFrame::ContextFrame(const String& message) ContextFrame::ContextFrame(const String& message)
{ {
GetFrames().insert(GetFrames().begin(), message); GetFrames().emplace_back(message);
} }
ContextFrame::~ContextFrame() ContextFrame::~ContextFrame()
{ {
GetFrames().erase(GetFrames().begin()); GetFrames().pop_back();
} }
std::vector<String>& ContextFrame::GetFrames() std::vector<String>& ContextFrame::GetFrames()
@ -27,7 +27,7 @@ std::vector<String>& ContextFrame::GetFrames()
} }
ContextTrace::ContextTrace() ContextTrace::ContextTrace()
: m_Frames(ContextFrame::GetFrames()) : m_Frames(ContextFrame::GetFrames().rbegin(), ContextFrame::GetFrames().rend())
{ } { }
void ContextTrace::Print(std::ostream& fp) const void ContextTrace::Print(std::ostream& fp) const