Removed `ss.str().data()` (the type of ss is std::stringstream).
Introduced variable that is const reference of `ss.str()`.
This commit is contained in:
Takatoshi Kondo
2019-08-29 20:22:10 +09:00
parent 3129326432
commit 70f950ac05
22 changed files with 203 additions and 112 deletions

View File

@@ -98,7 +98,8 @@ TEST(visitor, json_like)
std::string json_like;
json_like_visitor v(json_like);
std::size_t off = 0;
bool ret = msgpack::parse(ss.str().data(), ss.str().size(), off, v);
std::string const& str = ss.str();
bool ret = msgpack::parse(str.data(), str.size(), off, v);
EXPECT_TRUE(ret);
EXPECT_EQ("{\"key\":[42,null,true]}", json_like);
}