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

Issue 2417783004: Replace for loops with |arraysize| with for each loops (Closed)

Created:
4 years, 2 months ago by jdoerrie
Modified:
4 years, 2 months ago
Reviewers:
vabr (Chromium)
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, rouslan+autofill_chromium.org, jam, browser-components-watch_chromium.org, jdonnelly+autofillwatch_chromium.org, darin-cc_chromium.org, tfarina, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace for loops with |arraysize| with for each loops This change replaces for-loops involving a loop variable and the |arraysize| macro with a C++11 for-each-loop where appropriate. A few usages of |arraysize| in a for-loop remain, in these the loop variable is used as well. This can be simply logging the iteration number or indexing another array of the same size. BUG=655950 Committed: https://crrev.com/54e466c9fd2ff04136f8f305615910e8f9085642 Cr-Commit-Position: refs/heads/master@{#425651}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Adressed Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -213 lines) Patch
M components/autofill/content/renderer/form_cache.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M components/autofill/core/browser/address_i18n_unittest.cc View 2 chunks +8 lines, -8 lines 0 comments Download
M components/autofill/core/browser/address_unittest.cc View 1 2 chunks +5 lines, -6 lines 0 comments Download
M components/autofill/core/browser/autofill_data_util.cc View 1 chunk +6 lines, -7 lines 0 comments Download
M components/autofill/core/browser/autofill_ie_toolbar_import_win.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M components/autofill/core/browser/autofill_manager_unittest.cc View 4 chunks +16 lines, -15 lines 0 comments Download
M components/autofill/core/browser/autofill_merge_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/autofill/core/browser/autofill_profile.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M components/autofill/core/browser/contact_info_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/autofill/core/browser/credit_card.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M components/autofill/core/browser/credit_card_unittest.cc View 1 6 chunks +39 lines, -46 lines 0 comments Download
M components/autofill/core/browser/phone_field_unittest.cc View 1 6 chunks +12 lines, -12 lines 0 comments Download
M components/autofill/core/browser/phone_number_i18n_unittest.cc View 1 chunk +11 lines, -14 lines 0 comments Download
M components/autofill/core/browser/state_names.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc View 3 chunks +16 lines, -17 lines 0 comments Download
M components/autofill/core/browser/validation_unittest.cc View 1 2 chunks +20 lines, -25 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_table_unittest.cc View 2 chunks +8 lines, -9 lines 0 comments Download
M components/autofill/core/common/autofill_regexes_unittest.cc View 6 chunks +6 lines, -12 lines 0 comments Download
M components/autofill/core/common/autofill_util_unittest.cc View 3 chunks +22 lines, -23 lines 0 comments Download

Messages

Total messages: 17 (8 generated)
jdoerrie
4 years, 2 months ago (2016-10-14 11:16:17 UTC) #2
jdoerrie
The remaining usages of |arraysize| in a loop are the following: content/renderer/password_form_conversion_utils_browsertest.cc 326: for (size_t ...
4 years, 2 months ago (2016-10-14 11:25:26 UTC) #5
vabr (Chromium)
LGTM with comments. Thanks for the analysis! I agree that we should keep an explicit ...
4 years, 2 months ago (2016-10-17 07:40:33 UTC) #8
jdoerrie
https://codereview.chromium.org/2417783004/diff/1/components/autofill/content/renderer/form_cache.cc File components/autofill/content/renderer/form_cache.cc (right): https://codereview.chromium.org/2417783004/diff/1/components/autofill/content/renderer/form_cache.cc#newcode48 components/autofill/content/renderer/form_cache.cc:48: for (const auto& str : deprecated) { On 2016/10/17 ...
4 years, 2 months ago (2016-10-17 08:42:27 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2417783004/20001
4 years, 2 months ago (2016-10-17 09:16:16 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 2 months ago (2016-10-17 10:46:41 UTC) #13
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/54e466c9fd2ff04136f8f305615910e8f9085642 Cr-Commit-Position: refs/heads/master@{#425651}
4 years, 2 months ago (2016-10-17 10:48:16 UTC) #15
henrika (OOO until Aug 14)
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2424793002/ by henrika@chromium.org. ...
4 years, 2 months ago (2016-10-17 12:15:08 UTC) #16
henrika (OOO until Aug 14)
4 years, 2 months ago (2016-10-17 12:31:20 UTC) #17
Message was sent while issue was closed.
My revert landed at 425651 and 425657 is green.
Looks like my revert was OK in this case.

Powered by Google App Engine
This is Rietveld 408576698