From 4b31192e3bfa7fd5cc14a57cabde66ada5c30b34 Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 16 May 2012 21:41:43 +0300 Subject: [PATCH] Some code fixes. --- base/logging.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/base/logging.cpp b/base/logging.cpp index 8e9bddb6e8..6567f4f424 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -40,14 +40,15 @@ namespace my static int threadsCount = 1; static map m_shortThreadID; - threads::ThreadID id = threads::GetCurrentThreadID(); - if (m_shortThreadID[id] == 0) - m_shortThreadID[id] = threadsCount++; + + int & threadNumber = m_shortThreadID[threads::GetCurrentThreadID()]; + if (threadNumber == 0) + threadNumber = threadsCount++; ostringstream out; out << "LOG"; - out << " TID(" << m_shortThreadID[id] << ")"; + out << " TID(" << threadNumber << ")"; static Timer s_Timer; static char const * names[] = { "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" };