From 7adedc8992196c792af8c744a2bbb1ccc0987e30 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Fri, 1 Nov 2019 23:16:05 +0300 Subject: [PATCH] ws: use std::pair instead of custom struct --- code/espurna/ws.ino | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/code/espurna/ws.ino b/code/espurna/ws.ino index 132a596c..51087464 100644 --- a/code/espurna/ws.ino +++ b/code/espurna/ws.ino @@ -204,13 +204,7 @@ bool _wsAuth(AsyncWebSocketClient * client) { #if DEBUG_WEB_SUPPORT -struct ws_debug_msg_t { - ws_debug_msg_t(const char* prefix, const char* message) : - prefix(prefix), message(message) - {} - String prefix; - String message; -}; +using ws_debug_msg_t = std::pair; struct ws_debug_t { @@ -257,8 +251,8 @@ struct ws_debug_t { JsonArray& pre = weblog.createNestedArray("pre"); for (auto& message : messages) { - pre.add(message.prefix.c_str()); - msg.add(message.message.c_str()); + pre.add(message.first.c_str()); + msg.add(message.second.c_str()); } wsSend(root);