Skip to content

Update get_callback_id, register_callback #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/signalrclient/callback_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "stdafx.h"
#include "callback_manager.h"
#include <sstream>

namespace signalr
{
Expand All @@ -26,8 +25,7 @@ namespace signalr

{
std::lock_guard<std::mutex> lock(m_map_lock);

m_callbacks.insert(std::make_pair(callback_id, callback));
m_callbacks.emplace(callback_id, callback);
}

return callback_id;
Expand Down Expand Up @@ -86,8 +84,6 @@ namespace signalr
std::string callback_manager::get_callback_id()
{
const auto callback_id = m_id++;
std::stringstream ss;
ss << callback_id;
return ss.str();
return std::to_string(callback_id);
}
}
4 changes: 3 additions & 1 deletion src/signalrclient/callback_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
#pragma once

#include <atomic>
#include <unordered_map>
#include <functional>
#include <mutex>
#include <string>
#include <unordered_map>

#include "signalrclient/signalr_value.h"

namespace signalr
Expand Down