crashpad/tools
Mark Mentovai d5ddd14ee1 Improve map insertion operations.
Add MapInsertOrReplace<>() to insert a key-value pair into a map if the
key is not already present, or replace the existing value for key if the
key is present. The original value can optionally be returned to the
caller in this case.

Map insertions now use either MapInsertOrReplace<>() or
std::map<>::insert() directly.

Use MapInsertOrReplace<>() when the map should be updated to contain a
mapping from a key to a value regardless of whether the key is already
present.

Use std::map<>::insert() to insert a mapping from a key to a value
without replacing any existing mapping from a key, if present. If it is
important to know whether an existing mapping from a key was present,
use the returned std::pair<>.second. If it is important to know the
existing value, use the returned std::pair<>.first->second.

This change has a slight positive impact on performance.

TEST=crashpad_util_test MapInsert.MapInsertOrReplace and others
BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1044273002
2015-03-31 14:29:32 -04:00
..
mac Improve map insertion operations. 2015-03-31 14:29:32 -04:00
crashpad_database_util.ad Add crashpad_database_util and its man page. 2015-03-19 18:41:01 -04:00
crashpad_database_util.cc Add crashpad_database_util and its man page. 2015-03-19 18:41:01 -04:00
generate_dump.ad Allow man pages to link to each other 2015-03-18 17:13:22 -04:00
generate_dump.cc Add crashpad_database_util and its man page. 2015-03-19 18:41:01 -04:00
tool_support.cc Add on_demand_service_tool. 2014-08-20 15:18:55 -04:00
tool_support.h Add on_demand_service_tool. 2014-08-20 15:18:55 -04:00
tools.gyp Add crashpad_database_util and its man page. 2015-03-19 18:41:01 -04:00