diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-24 17:09:17 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-24 17:09:17 -0700 |
commit | 2fb94e3c4c4ade042fc1944f1bfa64609bff40b4 (patch) | |
tree | a3b649a53a0b634d3110daf2f8357d372a560841 /cpp/003trace | |
parent | 544a1f1e17d909673f08a50b97fc9d00df431eb4 (diff) | |
download | mu-2fb94e3c4c4ade042fc1944f1bfa64609bff40b4.tar.gz |
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.
Diffstat (limited to 'cpp/003trace')
-rw-r--r-- | cpp/003trace | 11 |
1 files changed, 5 insertions, 6 deletions
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<pair<string, pair<int, string> > > past_lines; // [(layer label, frame, line)] - unordered_map<string, int> frame; + map<string, int> frame; // accumulator for current line ostringstream* curr_stream; string curr_layer; @@ -458,11 +458,10 @@ using std::vector; using std::list; #include<utility> using std::pair; - -#include<tr1/unordered_map> -using std::tr1::unordered_map; -#include<tr1/unordered_set> -using std::tr1::unordered_set; +#include<map> +using std::map; +#include<set> +using std::set; #include<algorithm> #include<iostream> |