| commit | cc92cd3b109b59b30ff8b5e6b410a1d2ca9c1774 | [log] [tgz] |
|---|---|---|
| author | Andrew de los Reyes <adlr@chromium.org> | Tue Oct 05 16:56:14 2010 -0700 |
| committer | Andrew de los Reyes <adlr@chromium.org> | Tue Oct 05 16:56:14 2010 -0700 |
| tree | e14c7a2eea7d09e1fe5a5ee8229dc86f29fa2f59 | |
| parent | 182a9f51c753810c5985ac70c5da5b98b35b6cd4 [diff] |
AU: ApplyMap utility function
ApplyMap takes a vector<ValueType> and a map of
ValueType->ValueType. For each object in the collection that is a key
in the map, replace that element with the corresponding value in the
map.
E.g. ApplyMap({1, 2, 3, 4, 5}, {3->6, 5->7, 8->10}) changes the
collection to be: {1, 2, 6, 4, 7}.
BUG=7294
TEST=attached unittest
Review URL: http://codereview.chromium.org/3530011