Commit c0fcdcc4 authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

GenericValue: use generated assignment/destructor for GenericMember

parent 59fee54f
...@@ -464,8 +464,7 @@ public: ...@@ -464,8 +464,7 @@ public:
case kObjectFlag: case kObjectFlag:
for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) {
m->name.~GenericValue(); m->~GenericMember();
m->value.~GenericValue();
} }
Allocator::Free(data_.o.members); Allocator::Free(data_.o.members);
break; break;
...@@ -861,13 +860,11 @@ public: ...@@ -861,13 +860,11 @@ public:
MemberIterator last(data_.o.members + (data_.o.size - 1)); MemberIterator last(data_.o.members + (data_.o.size - 1));
if (data_.o.size > 1 && m != last) { if (data_.o.size > 1 && m != last) {
// Move the last one to this place // Move the last one to this place
m->name = last->name; *m = *last;
m->value = last->value;
} }
else { else {
// Only one left, just destroy // Only one left, just destroy
m->name.~GenericValue(); m->~GenericMember();
m->value.~GenericValue();
} }
--data_.o.size; --data_.o.size;
return m; return m;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment