aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2019-11-04 01:06:01 +0000
committerLee Clagett <code@leeclagett.com>2019-11-04 01:46:41 +0000
commita9bdc6e4c4e9ec73226e5b4d2261f54bb0b14cf1 (patch)
tree1d9db9041b13c2f458e9dcba326625631fb4c3c5 /tests
parentMerge pull request #6174 (diff)
downloadmonero-a9bdc6e4c4e9ec73226e5b4d2261f54bb0b14cf1.tar.xz
Improved performance for epee serialization:
- Removed copy of field names in binary deserialization - Removed copy of array values in binary deserialization - Removed copy of string values in json deserialization - Removed unhelpful allocation in json string value parsing - Removed copy of blob data on binary and json serialization
Diffstat (limited to '')
-rw-r--r--tests/unit_tests/net.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit_tests/net.cpp b/tests/unit_tests/net.cpp
index 262541bd2..221dc631d 100644
--- a/tests/unit_tests/net.cpp
+++ b/tests/unit_tests/net.cpp
@@ -271,7 +271,7 @@ TEST(tor_address, epee_serializev_v2)
EXPECT_EQ(std::strlen(v2_onion), host.size());
host.push_back('k');
- EXPECT_TRUE(stg.set_value("host", host, stg.open_section("tor", nullptr, false)));
+ EXPECT_TRUE(stg.set_value("host", std::move(host), stg.open_section("tor", nullptr, false)));
EXPECT_TRUE(command.load(stg)); // poor error reporting from `KV_SERIALIZE`
}
@@ -322,7 +322,7 @@ TEST(tor_address, epee_serializev_v3)
EXPECT_EQ(std::strlen(v3_onion), host.size());
host.push_back('k');
- EXPECT_TRUE(stg.set_value("host", host, stg.open_section("tor", nullptr, false)));
+ EXPECT_TRUE(stg.set_value("host", std::move(host), stg.open_section("tor", nullptr, false)));
EXPECT_TRUE(command.load(stg)); // poor error reporting from `KV_SERIALIZE`
}
@@ -373,7 +373,7 @@ TEST(tor_address, epee_serialize_unknown)
EXPECT_EQ(std::strlen(net::tor_address::unknown_str()), host.size());
host.push_back('k');
- EXPECT_TRUE(stg.set_value("host", host, stg.open_section("tor", nullptr, false)));
+ EXPECT_TRUE(stg.set_value("host", std::move(host), stg.open_section("tor", nullptr, false)));
EXPECT_TRUE(command.load(stg)); // poor error reporting from `KV_SERIALIZE`
}