File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,16 +259,13 @@ MaybeMDI MultiDimInter::compact(const MultiDimInter& other) const
259259rapidjson::Value toJSON (MultiDimInter mdi
260260 , rapidjson::Document::AllocatorType& alloc)
261261{
262- rapidjson::Value result{rapidjson::kArrayType };
263-
264262 rapidjson::Value interval_array{rapidjson::kArrayType };
265263 for (const Interval& i : mdi) {
266264 rapidjson::Value jth = toJSON (i, alloc);
267265 interval_array.PushBack (jth, alloc);
268266 }
269- rapidjson::Value mdi_obj{rapidjson::kObjectType };
270- mdi_obj.AddMember (" bounds" , interval_array, alloc);
271- result.PushBack (mdi_obj, alloc);
267+ rapidjson::Value result{rapidjson::kObjectType };
268+ result.AddMember (" bounds" , interval_array, alloc);
272269
273270 return result;
274271}
Original file line number Diff line number Diff line change @@ -681,16 +681,13 @@ void OrderedSet::compact()
681681
682682rapidjson::Value toJSON (OrderedSet s, rapidjson::Document::AllocatorType& alloc)
683683{
684- rapidjson::Value result{rapidjson::kArrayType };
685-
686684 rapidjson::Value mdi_array{rapidjson::kArrayType };
687685 for (const MultiDimInter& mdi : s) {
688686 rapidjson::Value jth = detail::toJSON (mdi, alloc);
689687 mdi_array.PushBack (jth, alloc);
690688 }
691- rapidjson::Value mdi_obj{rapidjson::kObjectType };
692- mdi_obj.AddMember (" pieces" , mdi_array, alloc);
693- result.PushBack (mdi_obj, alloc);
689+ rapidjson::Value result{rapidjson::kObjectType };
690+ result.AddMember (" pieces" , mdi_array, alloc);
694691
695692 return result;
696693}
Original file line number Diff line number Diff line change @@ -492,16 +492,16 @@ OrdUnidimDenseSet OrdUnidimDenseSet::traverse(
492492rapidjson::Value toJSON (OrdUnidimDenseSet s
493493 , rapidjson::Document::AllocatorType& alloc)
494494{
495- rapidjson::Value result{rapidjson::kArrayType };
496-
497495 rapidjson::Value interval_array{rapidjson::kArrayType };
498496 for (const Interval& i : s) {
499- rapidjson::Value jth = detail::toJSON (i, alloc);
497+ rapidjson::Value jth_array{rapidjson::kArrayType };
498+ jth_array.PushBack (detail::toJSON (i, alloc), alloc);
499+ rapidjson::Value jth{rapidjson::kObjectType };
500+ jth.AddMember (" bounds" , jth_array, alloc);
500501 interval_array.PushBack (jth, alloc);
501502 }
502- rapidjson::Value mdi_obj{rapidjson::kObjectType };
503- mdi_obj.AddMember (" pieces" , interval_array, alloc);
504- result.PushBack (mdi_obj, alloc);
503+ rapidjson::Value result{rapidjson::kObjectType };
504+ result.AddMember (" pieces" , interval_array, alloc);
505505
506506 return result;
507507}
Original file line number Diff line number Diff line change @@ -484,16 +484,13 @@ void UnorderedSet::compact()
484484rapidjson::Value toJSON (UnorderedSet s
485485 , rapidjson::Document::AllocatorType& alloc)
486486{
487- rapidjson::Value result{rapidjson::kArrayType };
488-
489487 rapidjson::Value mdi_array{rapidjson::kArrayType };
490488 for (const MultiDimInter& mdi : s) {
491489 rapidjson::Value jth = detail::toJSON (mdi, alloc);
492490 mdi_array.PushBack (jth, alloc);
493491 }
494- rapidjson::Value mdi_obj{rapidjson::kObjectType };
495- mdi_obj.AddMember (" pieces" , mdi_array, alloc);
496- result.PushBack (mdi_obj, alloc);
492+ rapidjson::Value result{rapidjson::kObjectType };
493+ result.AddMember (" pieces" , mdi_array, alloc);
497494
498495 return result;
499496}
You can’t perform that action at this time.
0 commit comments