XThread::set_name - Use more efficient xe::format_string instead of a StringBuffer

This commit is contained in:
Dr. Chat 2015-12-02 14:35:28 -06:00 committed by Ben Vanik
parent e4e1bc1060
commit e54850e1f2
1 changed files with 2 additions and 5 deletions

View File

@ -137,15 +137,12 @@ void XThread::set_last_error(uint32_t error_code) {
} }
void XThread::set_name(const std::string& name) { void XThread::set_name(const std::string& name) {
StringBuffer buff; name_ = xe::format_string("%s (%.8X)", name, handle());
buff.Append(name);
buff.AppendFormat(" (%.8X)", handle());
name_ = buff.ToString();
if (thread_) { if (thread_) {
// May be getting set before the thread is created. // May be getting set before the thread is created.
// One the thread is ready it will handle it. // One the thread is ready it will handle it.
thread_->set_name(buff.ToString()); thread_->set_name(name_);
} }
} }