New issue
Advanced search Search tips

Issue 875665 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Use base::Erase and base::EraseIf

Project Member Reported by jinho.b...@samsung.com, Aug 19

Issue description

It's much easier to write:
  base::Erase(container, value);
  base::EraseIf(container, ...);
than:
  container.erase(std::remove(container.begin(), container.end(), value), container.end())
  container.erase(std::remove_if(container.begin(), container.end(), ...), container.end())
 
I made this issue for first-time contributors, who are attending "Contributhon 2018".
The "Contributhon" means "Contribution + Marathon".
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8

commit a248d5c3e929268bae58e3f5b1a39371a2a6c5f8
Author: Jdragon <jdragon.bae@gmail.com>
Date: Fri Aug 24 12:46:42 2018

Use base::Erase(), base::EraseIf() in components/

This patch is just a code simplification.

It's much easier to write:
  base::Erase(container, value);
  base::EraseIf(container, ...);
than:
  container.erase(std::remove(container.begin(),
      container.end(), value), container.end());
  container.erase(std::remove_if(container.begin(),
      container.end(), ...), container.end());

Bug: 875665
Change-Id: I4eb9f77b58befd58c6c978eb7ce591b5d95bd613
Reviewed-on: https://chromium-review.googlesource.com/1181483
Reviewed-by: Jinho Bang <jinho.bang@samsung.com>
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#585811}
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/AUTHORS
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/autofill/content/renderer/html_based_username_detector.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/autofill/core/browser/autofill_external_delegate.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/autofill/core/browser/personal_data_manager.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/certificate_transparency/chrome_require_ct_delegate.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/crash/content/app/minidump_with_crashpad_info.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/crash/content/app/run_as_crashpad_handler_win.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/cryptauth/fake_connection.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/dom_distiller/core/task_tracker.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/gcm_driver/instance_id/instance_id_impl.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/ntp_snippets/contextual/reporting/contextual_suggestions_debugging_reporter.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/omnibox/browser/autocomplete_result.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/omnibox/browser/base_search_provider.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/omnibox/browser/shortcuts_provider.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/password_manager/core/browser/password_manager_util_unittest.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/password_manager/core/browser/password_reuse_detector.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/safe_browsing/web_ui/safe_browsing_ui.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/signin/core/browser/account_reconcilor.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/subresource_filter/tools/ruleset_converter/rule_stream_unittest.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/sync_bookmarks/synced_bookmark_tracker.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/translate/core/language_detection/chinese_script_classifier.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/update_client/utils.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/variations/synthetic_trial_registry.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/zucchini/address_translator.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/zucchini/ensemble_matcher.cc
[modify] https://crrev.com/a248d5c3e929268bae58e3f5b1a39371a2a6c5f8/components/zucchini/equivalence_map.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71aa38ffb5eb3d17890ca60dd8fc98a373275c6b

commit 71aa38ffb5eb3d17890ca60dd8fc98a373275c6b
Author: Jaewon Choi <jaewon.james.choi@gmail.com>
Date: Mon Aug 27 18:21:51 2018

gpu: Replace erase(std::remove_if()) to base::EraseIf()

This patch replaces erase(std::remove_if()) to base::EraseIf()
for simplicity.

Bug: 875665
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ib2e310f38eae8917445cd62b57a1ffb9d873f8cc
Reviewed-on: https://chromium-review.googlesource.com/1181016
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#586321}
[modify] https://crrev.com/71aa38ffb5eb3d17890ca60dd8fc98a373275c6b/AUTHORS
[modify] https://crrev.com/71aa38ffb5eb3d17890ca60dd8fc98a373275c6b/gpu/command_buffer/client/query_tracker.cc
[modify] https://crrev.com/71aa38ffb5eb3d17890ca60dd8fc98a373275c6b/gpu/command_buffer/service/context_group.cc
[modify] https://crrev.com/71aa38ffb5eb3d17890ca60dd8fc98a373275c6b/gpu/command_buffer/service/gles2_cmd_decoder.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/562fb11a3c105a02db4c0931f7764b8d7fadd6cd

commit 562fb11a3c105a02db4c0931f7764b8d7fadd6cd
Author: Eunseok Oh <fivesilverstone@gmail.com>
Date: Mon Aug 27 19:03:08 2018

Replace erase(std::remove()) to base::Erase() in media

This patch replaces the erase(std::remove()) used in the media folder
with base::Erase().

Bug: 875665
Change-Id: Id832871a1fbfcb657e4160f57ff206f93950e7ab
Reviewed-on: https://chromium-review.googlesource.com/1180953
Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#586355}
[modify] https://crrev.com/562fb11a3c105a02db4c0931f7764b8d7fadd6cd/AUTHORS
[modify] https://crrev.com/562fb11a3c105a02db4c0931f7764b8d7fadd6cd/media/gpu/android/avda_picture_buffer_manager.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 27

Project Member

Comment 6 by bugdroid1@chromium.org, Sep 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b4b45778da224efba92a1e4509b40ccaf36521c

commit 0b4b45778da224efba92a1e4509b40ccaf36521c
Author: Eugene Kim <eugene70kim@gmail.com>
Date: Sat Sep 01 02:37:58 2018

Use base::Erase() instead of erase(std::remove()) in chrome/

It's much easier to write:
  base::Erase(container, value);
  base::EraseIf(container, ...);
than:
  container.erase(std::remove(container.begin(),
      container.end(), value), container.end());
  container.erase(std::remove_if(container.begin(),
      container.end(), ...), container.end());

Bug: 875665
Change-Id: Iadfcce0915d215085d515e13b6faa745462d11b8
Reviewed-on: https://chromium-review.googlesource.com/1190403
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588249}
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/AUTHORS
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/app/chrome_exe_main_win.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/banners/app_banner_manager.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/chromeos/arc/input_method_manager/arc_input_method_manager_service_unittest.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/chromeos/extensions/gfx_utils.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/engagement/site_engagement_helper.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/extensions/api/automation_internal/automation_event_router.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/extensions/api/i18n/i18n_api.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/media_galleries/fileapi/media_path_filter.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/memory_details.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/plugins/plugin_info_host_impl.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/prerender/prerender_manager.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/task_manager/sampling/task_group.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
[modify] https://crrev.com/0b4b45778da224efba92a1e4509b40ccaf36521c/chrome/chrome_cleaner/crash/crashpad_crash_reporter.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/26ee5eeab66b1c770e7c3590882ac7b41f930186

commit 26ee5eeab66b1c770e7c3590882ac7b41f930186
Author: Eunseok Oh <fivesilverstone@gmail.com>
Date: Sat Sep 08 03:06:08 2018

Replace erase(std::remove()) and erase(std::remove_if()) in net

This patch replaces the erase(std::remove()) and
erase(std::remove_if()) used in the net folder
with base::Erase() and base::EraseIf().

Bug: 875665
Change-Id: I3143eccb4da2f53e600c0a75f798e41af78e08dd
Reviewed-on: https://chromium-review.googlesource.com/1203514
Reviewed-by: Matt Mueller <mattm@chromium.org>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#589763}
[modify] https://crrev.com/26ee5eeab66b1c770e7c3590882ac7b41f930186/net/nqe/observation_buffer.cc
[modify] https://crrev.com/26ee5eeab66b1c770e7c3590882ac7b41f930186/net/url_request/url_request_test_job.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Oct 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8

commit 095a273ae893a11528a2a19dbf23dbbdd1e0d8e8
Author: Yeonwoo Jo <yeonwoo.jo.92@gmail.com>
Date: Wed Oct 03 17:10:40 2018

Use base::EraseIf() instead of erase(std::remove_if()) in content/

This patch simplifies conditions around the code in content/.

Bug: 875665
Change-Id: I52e639adce40a86e20304ee64c52d3b399c39841
Reviewed-on: https://chromium-review.googlesource.com/1215147
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#596261}
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/AUTHORS
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/browser/media/media_internals.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/browser/renderer_host/input/passthrough_touch_event_queue_unittest.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/browser/renderer_host/media/media_devices_manager.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/browser/webrtc/webrtc_depth_capture_browsertest.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/browser/webrtc/webrtc_webcam_browsertest.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/renderer/media/audio/audio_renderer_sink_cache_impl.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/renderer/media/webrtc/webrtc_audio_renderer.cc
[modify] https://crrev.com/095a273ae893a11528a2a19dbf23dbbdd1e0d8e8/content/test/web_contents_observer_sanity_checker.cc

Sign in to add a comment