]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- coding style 986/head
authorArvin Schnell <aschnell@suse.de>
Wed, 29 Jan 2025 07:32:53 +0000 (08:32 +0100)
committerArvin Schnell <aschnell@suse.de>
Wed, 29 Jan 2025 07:32:53 +0000 (08:32 +0100)
stomp/Stomp.cc
stomp/Stomp.h
testsuite-real/common.cc
zypp-plugin/zypp-plugin.cc

index 085fb5dc84d846bc0368a2f27f7667b9efb777b8..6dfb1aaf4b31721600385cdf42d33a39fdb4ea88 100644 (file)
@@ -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");
     }
 
 
index 1a024da6345d58351ca7d2b608b06f05f9cc7de1..f26eb333f245c22e75a57769bbf4c337b665d36b 100644 (file)
@@ -39,6 +39,9 @@ namespace Stomp
 
     struct Message
     {
+       Message() {}
+       Message(const std::string& command) : command(command) {}
+
        std::string command;
        std::map<std::string, std::string> headers;
        std::string body;
index 55df60af073ba40866b8de4f68e370643f4e0f29..f5b7d464a7bfe1dc3c9d5810164fdaad4cdff926 100644 (file)
@@ -96,6 +96,7 @@ check_xa_undo_statistics(unsigned int xaNumCreate, unsigned xaNumReplace, unsign
 }
 #endif
 
+
 void
 undo()
 {
index b41e57d5bd0df790c8318a31d68dcbe6a33ad174..122cf2e425906c35952fc294ff5e926a2789bee5 100644 (file)
@@ -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;
 }