From e0ed30c1f7e6772efaed4074949d4eb87d613787 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Thu, 28 Dec 2023 19:05:50 -0800 Subject: [PATCH] fix unnecessary copy --- src/JSON.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JSON.hh b/src/JSON.hh index 0039cb4..0427d86 100644 --- a/src/JSON.hh +++ b/src/JSON.hh @@ -108,7 +108,7 @@ public: for (const auto& item : x) { v.emplace_back(new JSON(item)); } - this->value = v; + this->value = std::move(v); } // Dict constructors @@ -121,7 +121,7 @@ public: for (const auto& item : x) { v.emplace(item.first, new JSON(item.second)); } - this->value = v; + this->value = std::move(v); } // Copy/move constructors