]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2768] Remove some more references
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 11 Mar 2013 08:49:04 +0000 (09:49 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 11 Mar 2013 08:49:04 +0000 (09:49 +0100)
They save only little bit of work to the CPU and are suspicious to
casual reader, even when they should be safe in theory.

src/lib/config/ccsession.cc
src/lib/config/tests/ccsession_unittests.cc

index c649e270e6c763bc604048731945cd92601adea1..78432ab9aeb3a8ffc643722f996479f8b7f6b562 100644 (file)
@@ -869,7 +869,7 @@ ModuleCCSession::rpcCall(const std::string &command, const std::string &group,
         arg(group).arg(seq);
     groupRecvMsg(env, answer, true, seq);
     int rcode;
-    const ConstElementPtr &result(parseAnswer(rcode, answer));
+    const ConstElementPtr result(parseAnswer(rcode, answer));
     if (rcode == isc::cc::CC_REPLY_NO_RECPT) {
         isc_throw(RPCRecipientMissing, result);
     } else if (rcode != isc::cc::CC_REPLY_SUCCESS) {
index b7b126746c4e75b9b613e3652f4e4fa4911bdb8a..8d8bb47338439603398d6acc0ce2977aeb336f93 100644 (file)
@@ -62,16 +62,18 @@ protected:
         ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL,
                              false, false);
         // Prepare the answer beforehand, it'll block until it gets one
-        const ConstElementPtr& reply_el(el(reply));
+        const ConstElementPtr reply_el(el(reply));
         session.getMessages()->add(reply_el);
-        const ConstElementPtr& result(mccs.rpcCall("test", "Spec2",
-                                                   el("{\"param1\": \"Param 1\","
-                                                      "\"param2\": \"Param 2\"}")));
-        const ConstElementPtr& request(el("[\"Spec2\", \"*\", {"
-                                          "  \"command\": [\"test\", {"
-                                          "    \"param1\": \"Param 1\","
-                                          "    \"param2\": \"Param 2\""
-                                          "}]}, -1, true]"));
+        const ConstElementPtr
+            result(mccs.rpcCall("test", "Spec2",
+                                el("{\"param1\": \"Param 1\","
+                                   "\"param2\": \"Param 2\"}")));
+        const ConstElementPtr
+            request(el("[\"Spec2\", \"*\", {"
+                       "  \"command\": [\"test\", {"
+                       "    \"param1\": \"Param 1\","
+                       "    \"param2\": \"Param 2\""
+                       "}]}, -1, true]"));
         // The 0th one is from the initialization, to ConfigManager.
         // our is the 1st.
         EXPECT_TRUE(request->equals(*session.getMsgQueue()->get(1))) <<
@@ -88,7 +90,7 @@ protected:
 // Test we can send an RPC (command) and get an answer. The answer is success
 // in this case.
 TEST_F(CCSessionTest, rpcCallSuccess) {
-    const ConstElementPtr &result =
+    const ConstElementPtr result =
         rpcCheck("{\"result\": [0, {\"Hello\": \"a\"}]}");
     EXPECT_TRUE(el("{\"Hello\": \"a\"}")->equals(*result));
 }