Improve and simplify code with modern C++ features
Change-Id: I83bf5513c2a1f90ba5a59e93c473306864b27d94
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index 97af039..4262287 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.cpp
@@ -97,7 +97,7 @@
bool isOk = false;
Block element;
- std::tie(isOk, element) = Block::fromBuffer(reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size());
+ std::tie(isOk, element) = Block::fromBuffer(reinterpret_cast<const uint8_t*>(msg.data()), msg.size());
if (!isOk) {
NFD_LOG_FACE_WARN("Failed to parse message payload");
return;
@@ -109,7 +109,7 @@
void
WebSocketTransport::schedulePing()
{
- m_pingEventId = scheduler::schedule(m_pingInterval, bind(&WebSocketTransport::sendPing, this));
+ m_pingEventId = scheduler::schedule(m_pingInterval, [this] { sendPing(); });
}
void