|
|
DescriptionFix a space problem with the use of XkbKeyboardLayoutEngine::xkb_flag_map_
In XkbKeyboardLayoutEngine::SetKeymap, xkb_flag_map_ is "cleared" and
its resized to a known size 'n'. At this point, and all values are zero'ed out.
Later on, std::vector<type>::push_back is used to populate the vector.
Problem is that the new entries are inserted after the set of 'n' zero'ed out entries.
CL fixes it by using std::vector<type::reserve instead.
Review-Url: https://codereview.chromium.org/2649233002
Cr-Commit-Position: refs/heads/master@{#445801}
Committed: https://chromium.googlesource.com/chromium/src/+/c6ddb615e307d10bff949570707cbaa964f5795d
Patch Set 1 #
Total comments: 1
Patch Set 2 : addressed spang's remark #Messages
Total messages: 20 (13 generated)
The CQ bit was checked by tonikitoo@igalia.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
tonikitoo@igalia.com changed reviewers: + spang@chromium.org
PTAL (quick driven by CL)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
Good catch. You can fix it by changing resize() to reserve(). https://codereview.chromium.org/2649233002/diff/1/ui/events/ozone/layout/xkb/... File ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc (right): https://codereview.chromium.org/2649233002/diff/1/ui/events/ozone/layout/xkb/... ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc:824: xkb_flag_map_.resize(arraysize(flags)); reserve()
On 2017/01/23 23:29:04, spang wrote: > Good catch. You can fix it by changing resize() to reserve(). > > https://codereview.chromium.org/2649233002/diff/1/ui/events/ozone/layout/xkb/... > File ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc (right): > > https://codereview.chromium.org/2649233002/diff/1/ui/events/ozone/layout/xkb/... > ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc:824: > xkb_flag_map_.resize(arraysize(flags)); > reserve() Done.
Description was changed from ========== Fix a space problem with the use of XkbKeyboardLayoutEngine::xkb_flag_map_ In XkbKeyboardLayoutEngine::SetKeymap, xkb_flag_map_ is "cleared" and its known size 'n' is reserved. At this point, the vector sizes 'n', and all values are zero'ed out. Later on, std::vector<type>::push_back is used to populate the vector and new entries are inserted after the set of 'n' zero'ed out entries. CL fixes it by using the [] operator to set values. ========== to ========== Fix a space problem with the use of XkbKeyboardLayoutEngine::xkb_flag_map_ In XkbKeyboardLayoutEngine::SetKeymap, xkb_flag_map_ is "cleared" and its resized to a known size 'n'. At this point, and all values are zero'ed out. Later on, std::vector<type>::push_back is used to populate the vector. Problem is that the new entries are inserted after the set of 'n' zero'ed out entries. CL fixes it by using std::vector<type::reserve instead. ==========
The CQ bit was checked by tonikitoo@igalia.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
informal l g t m
The CQ bit was checked by spang@chromium.org
lgtm
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 20001, "attempt_start_ts": 1485289368223230, "parent_rev": "347f7a59d1fe355675e1844d0c1e2caa993985df", "commit_rev": "c6ddb615e307d10bff949570707cbaa964f5795d"}
Message was sent while issue was closed.
Description was changed from ========== Fix a space problem with the use of XkbKeyboardLayoutEngine::xkb_flag_map_ In XkbKeyboardLayoutEngine::SetKeymap, xkb_flag_map_ is "cleared" and its resized to a known size 'n'. At this point, and all values are zero'ed out. Later on, std::vector<type>::push_back is used to populate the vector. Problem is that the new entries are inserted after the set of 'n' zero'ed out entries. CL fixes it by using std::vector<type::reserve instead. ========== to ========== Fix a space problem with the use of XkbKeyboardLayoutEngine::xkb_flag_map_ In XkbKeyboardLayoutEngine::SetKeymap, xkb_flag_map_ is "cleared" and its resized to a known size 'n'. At this point, and all values are zero'ed out. Later on, std::vector<type>::push_back is used to populate the vector. Problem is that the new entries are inserted after the set of 'n' zero'ed out entries. CL fixes it by using std::vector<type::reserve instead. Review-Url: https://codereview.chromium.org/2649233002 Cr-Commit-Position: refs/heads/master@{#445801} Committed: https://chromium.googlesource.com/chromium/src/+/c6ddb615e307d10bff949570707c... ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/c6ddb615e307d10bff949570707c... |