More style.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace xe {
|
||||
template <typename... Args>
|
||||
class Delegate {
|
||||
public:
|
||||
typedef std::function<void(Args&...)> Listener;
|
||||
typedef std::function<void(Args...)> Listener;
|
||||
|
||||
void AddListener(Listener const& listener) {
|
||||
std::lock_guard<std::mutex> guard(lock_);
|
||||
@@ -33,7 +33,7 @@ class Delegate {
|
||||
listeners_.clear();
|
||||
}
|
||||
|
||||
void operator()(Args&... args) {
|
||||
void operator()(Args... args) {
|
||||
std::lock_guard<std::mutex> guard(lock_);
|
||||
for (auto& listener : listeners_) {
|
||||
listener(args...);
|
||||
|
||||
@@ -42,7 +42,9 @@ void format_log_line(char* buffer, size_t buffer_capacity,
|
||||
*(buffer_ptr++) = level_char;
|
||||
*(buffer_ptr++) = '>';
|
||||
*(buffer_ptr++) = ' ';
|
||||
buffer_ptr += sprintf(buffer_ptr, "%.4X", xe::threading::current_thread_id());
|
||||
buffer_ptr +=
|
||||
std::snprintf(buffer_ptr, buffer_capacity - (buffer_ptr - buffer), "%.4X",
|
||||
xe::threading::current_thread_id());
|
||||
*(buffer_ptr++) = ' ';
|
||||
|
||||
// Scribble args into the print buffer.
|
||||
|
||||
Reference in New Issue
Block a user