From 6477c2e271f1ca9371e5018361fa958d6713ed45 Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Sat, 13 Apr 2019 08:31:26 +0200 Subject: [PATCH] revert: faster serialization --- playground/hpt/IR_save_result.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/playground/hpt/IR_save_result.cpp b/playground/hpt/IR_save_result.cpp index 33b46476..83eec436 100644 --- a/playground/hpt/IR_save_result.cpp +++ b/playground/hpt/IR_save_result.cpp @@ -37,18 +37,9 @@ void emit_node_set(std::ofstream& f, node_set_t& ns) { emit_int32_t(f, RES_NODE_SET); emit_int32_t(f, ns.size()); - // get sorted key vector - std::vector keys; - keys.reserve (ns.size()); - for (auto& it : ns) { - keys.push_back(it.first); - } - std::sort (keys.begin(), keys.end()); - - // save items in sorted key order - for (auto& i: keys) { - emit_int32_t(f, i); - emit_node_item(f, ns[i]); + for (auto& i: ns) { + emit_int32_t(f, i.first); + emit_node_item(f, i.second); } }