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

Issue 2380643003: Mojo C++ bindings: Add mojo::Array<T>::reserve() (Closed)

Created:
4 years, 2 months ago by Luis Héctor Chávez
Modified:
4 years, 2 months ago
CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mojo C++ bindings: Add mojo::Array<T>::reserve() This is needed to avoid patterns like: mojo::Array<T> array(set.size()); size_t i = 0; for (const auto& element : set) { array[i++] = element; } and instead do: mojo::Array<T> array; array.reserve(set.size()); for (const auto& element : set) { array.push_back(element); } BUG=None Committed: https://crrev.com/1b7ca74a52b9ecf2d5e98d327db45a979af4d84c Cr-Commit-Position: refs/heads/master@{#421762}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M mojo/public/cpp/bindings/array.h View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Luis Héctor Chávez
rockot PTAL yzshen FYI
4 years, 2 months ago (2016-09-29 02:09:32 UTC) #2
Ken Rockot(use gerrit already)
Lgtm but FYI we'd like to get rid of mojo::Array anyway. If you remove use_new_wrapper_types=false ...
4 years, 2 months ago (2016-09-29 05:23:27 UTC) #3
Luis Héctor Chávez
On 2016/09/29 05:23:27, Ken Rockot wrote: > Lgtm but FYI we'd like to get rid ...
4 years, 2 months ago (2016-09-29 05:25:48 UTC) #4
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/2380643003/1
4 years, 2 months ago (2016-09-29 05:26:12 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-09-29 06:31:23 UTC) #7
commit-bot: I haz the power
4 years, 2 months ago (2016-09-29 06:33:37 UTC) #9
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/1b7ca74a52b9ecf2d5e98d327db45a979af4d84c
Cr-Commit-Position: refs/heads/master@{#421762}

Powered by Google App Engine
This is Rietveld 408576698