From 2fb94e3c4c4ade042fc1944f1bfa64609bff40b4 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 24 Apr 2015 17:09:17 -0700 Subject: 1166 Why did I think STL's map wasn't efficient? It has logarithmic complexity (maintains a tree internally) and is faster than hashing for small containers. It's the more portable solution and should be what I turn to by default. --- cpp/003trace | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'cpp/003trace') diff --git a/cpp/003trace b/cpp/003trace index af4858bf..f2070bae 100644 --- a/cpp/003trace +++ b/cpp/003trace @@ -93,7 +93,7 @@ Hide_warnings = false; :(before "End Tracing") struct trace_stream { vector > > past_lines; // [(layer label, frame, line)] - unordered_map frame; + map frame; // accumulator for current line ostringstream* curr_stream; string curr_layer; @@ -458,11 +458,10 @@ using std::vector; using std::list; #include using std::pair; - -#include -using std::tr1::unordered_map; -#include -using std::tr1::unordered_set; +#include +using std::map; +#include +using std::set; #include #include -- cgit 1.4.1-2-gfad0