Use std::vector to manage MapBuffer storage

Summary:
Replaces raw array pointer inside `MapBuffer` with `std::vector`, which is more conventional "safer" way of storing dynamically sized arrays.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33512115

fbshipit-source-id: d875a2240f7938fd35c4c3ae0e7e91dc7456ff32
This commit is contained in:
Andrei Shikov
2022-01-12 08:13:32 -08:00
committed by Facebook GitHub Bot
parent efc56b2790
commit aaff15c2c8
4 changed files with 47 additions and 47 deletions
@@ -108,6 +108,18 @@ TEST(MapBufferTest, testUTFStringEntry) {
EXPECT_EQ(map.getString(0), "Let's count: 的, 一, 是");
}
TEST(MapBufferTest, testEmojiStringEntry) {
auto builder = MapBufferBuilder();
builder.putString(
0, "Let's count: 1️⃣, 2️⃣, 3️⃣, 🤦🏿‍♀️");
auto map = builder.build();
EXPECT_EQ(
map.getString(0),
"Let's count: 1️⃣, 2️⃣, 3️⃣, 🤦🏿‍♀️");
}
TEST(MapBufferTest, testUTFStringEntries) {
auto builder = MapBufferBuilder();