From: Arvin Schnell Date: Wed, 29 Jan 2025 07:32:53 +0000 (+0100) Subject: - coding style X-Git-Tag: v0.12.2~23^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=b8ea0ed26c490aef4e82cf8730b57dc602b24380;p=thirdparty%2Fsnapper.git - coding style --- diff --git a/stomp/Stomp.cc b/stomp/Stomp.cc index 085fb5dc..6dfb1aaf 100644 --- a/stomp/Stomp.cc +++ b/stomp/Stomp.cc @@ -58,8 +58,7 @@ namespace Stomp if (regex_match(line, rx_command)) { - msg = Message(); - msg.command = line; + msg = Message(line); state = State::Headers; } else @@ -134,18 +133,14 @@ namespace Stomp Message ack() { - Message msg; - msg.command = "ACK"; - return msg; + return Message("ACK"); } Message nack() { - Message msg; - msg.command = "NACK"; - return msg; + return Message("NACK"); } diff --git a/stomp/Stomp.h b/stomp/Stomp.h index 1a024da6..f26eb333 100644 --- a/stomp/Stomp.h +++ b/stomp/Stomp.h @@ -39,6 +39,9 @@ namespace Stomp struct Message { + Message() {} + Message(const std::string& command) : command(command) {} + std::string command; std::map headers; std::string body; diff --git a/testsuite-real/common.cc b/testsuite-real/common.cc index 55df60af..f5b7d464 100644 --- a/testsuite-real/common.cc +++ b/testsuite-real/common.cc @@ -96,6 +96,7 @@ check_xa_undo_statistics(unsigned int xaNumCreate, unsigned xaNumReplace, unsign } #endif + void undo() { diff --git a/zypp-plugin/zypp-plugin.cc b/zypp-plugin/zypp-plugin.cc index b41e57d5..122cf2e4 100644 --- a/zypp-plugin/zypp-plugin.cc +++ b/zypp-plugin/zypp-plugin.cc @@ -49,8 +49,7 @@ ZyppPlugin::dispatch(const Message& msg) if (msg.command == "_DISCONNECT") return ack(); - Message a; - a.command = "_ENOMETHOD"; - a.headers["Command"] = msg.command; - return a; + Message reply("_ENOMETHOD"); + reply.headers["Command"] = msg.command; + return reply; }