Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1030)

Issue 3530011: AU: ApplyMap utility function (Closed)

Created:
10 years, 2 months ago by adlr
Modified:
9 years ago
Reviewers:
petkov
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Base URL:
ssh://git@chromiumos-git/update_engine.git
Visibility:
Public.

Description

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 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=cc92cd3

Patch Set 1 #

Patch Set 2 : don't need std::set in unittest #

Total comments: 2

Patch Set 3 : fixes for review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -0 lines) Patch
M utils.h View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M utils_unittest.cc View 1 2 2 chunks +22 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
adlr
10 years, 2 months ago (2010-10-05 19:12:33 UTC) #1
petkov
LGTM w/ a couple of suggestions. http://codereview.chromium.org/3530011/diff/2001/3001 File utils.h (right): http://codereview.chromium.org/3530011/diff/2001/3001#newcode190 utils.h:190: if (MapContainsKey(the_map, *it)) ...
10 years, 2 months ago (2010-10-05 22:00:34 UTC) #2
adlr
10 years, 2 months ago (2010-10-05 23:56:59 UTC) #3
thanks. fixed and pushed

Powered by Google App Engine
This is Rietveld 408576698