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

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed)

Created:
9 years, 9 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, vrk (LEFT CHROMIUM), tburkard+watch_chromium.org, kkania, amit, annacc, stuartmorgan+watch_chromium.org, ajwong+watch_chromium.org, dhollowa, cbentzel+watch_chromium.org, nkostylev+cc_chromium.org, idana, Erik does not do reviews, jam, apatrick_chromium, wez+watch_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, tim (not reviewing), dmaclach+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, Raghu Simha, ncarter (slow), Randy Smith (Not in Mondays), simonmorris+watch_chromium.org, pam+watch_chromium.org, sergeyu+watch_chromium.org, scherkus (not reviewing), jamiewalch+watch_chromium.org, hclam+watch_chromium.org, sjl, garykac+watch_chromium.org, Aaron Boodman, acolwell GONE FROM CHROMIUM, lambroslambrou+watch_chromium.org, davemoore+watch_chromium.org, rdsmith+dwatch_chromium.org, Paweł Hajdan Jr., jshin+watch_chromium.org
Visibility:
Public.

Description

Change other usages of .size() to .empty() when applicable. BUG=carnitas TEST=compiles Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=76962

Patch Set 1 #

Patch Set 2 : Up #

Total comments: 12

Patch Set 3 : Peter nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -158 lines) Patch
M base/command_line_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/file_path.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M base/process_util_posix.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/string_util.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/accessibility/browser_accessibility_win.cc View 1 2 8 chunks +13 lines, -12 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_match.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/history_contents_provider.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/automation/automation_provider_observers.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_context_menu_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/wizard_accessibility_handler.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/debugger/devtools_remote_listen_socket.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/debugger/extension_ports_remote_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/debugger/inspectable_tab_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_util.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_updater.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_updater_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/external_tab_container_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/gpu_process_host_ui_shim.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/history/history_publisher_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/history_types.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/query_parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/importer/firefox2_importer.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/importer/ie_importer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/plugin_exceptions_table_model_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/web_cache_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/engine/syncapi.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl2.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/foreign_session_tracker.cc View 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/clear_browsing_data_controller.mm View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/cocoa_test_helper.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/task_manager_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/dialogs_gtk.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/options/passwords_page_gtk.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/rounded_window.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/download_shelf_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/bug_report_ui.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/window_snapshot/window_snapshot_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/webdata/web_data_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/webdata/web_database_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/extension.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/extensions/extension_icon_set.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/update_manifest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/user_script.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/common/unix_domain_socket_posix.cc View 2 chunks +3 lines, -8 lines 0 comments Download
M chrome/common/web_apps_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/render_thread.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/webplugin_delegate_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/webworker_base.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/reliability/page_load_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/url_fetch_test/url_fetch_test.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/tools/crash_service/crash_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome_frame/chrome_frame_automation.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host.cc View 1 chunk +1 line, -1 line 0 comments Download
M courgette/adjustment_method.cc View 1 chunk +1 line, -1 line 0 comments Download
M courgette/encoded_program.cc View 1 chunk +1 line, -1 line 0 comments Download
M jingle/notifier/communicator/connection_settings.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/base/composite_filter.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M net/base/cookie_monster.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/dnssec_chain_verifier.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M net/base/x509_cert_types_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/x509_certificate_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/x509_certificate_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/socket/ssl_host_info.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/tools/flip_server/balsa_headers.h View 1 chunk +1 line, -1 line 0 comments Download
M net/tools/flip_server/output_ordering.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_job_tracker.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_throttler_entry.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/websockets/websocket_handshake_handler.cc View 6 chunks +11 lines, -11 lines 0 comments Download
M net/websockets/websocket_job.cc View 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/serialized_var.cc View 1 chunk +1 line, -1 line 0 comments Download
M remoting/base/compound_buffer.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M remoting/base/tracer.cc View 1 chunk +1 line, -1 line 0 comments Download
M remoting/jingle_glue/jingle_thread.cc View 1 chunk +1 line, -1 line 0 comments Download
M views/controls/tabbed_pane/native_tabbed_pane_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M views/view.cc View 1 chunk +1 line, -4 lines 0 comments Download
M views/view_text_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/gpu/webgraphicscontext3d_in_process_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/npapi/plugin_lib_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/test_shell_main.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
Elliot Glaysher
You'll find that all the nits from the last code review (sans ones in o3d/) ...
9 years, 9 months ago (2011-03-03 18:58:20 UTC) #1
Peter Kasting
9 years, 9 months ago (2011-03-03 19:35:52 UTC) #2
LGTM.  I found some more patterns for you to search the codebase for :D

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/accessibility...
File chrome/browser/accessibility/browser_accessibility_win.cc (right):

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/accessibility...
chrome/browser/accessibility/browser_accessibility_win.cc:119: LONG nav_dir,
VARIANT start, VARIANT* end) {
Nit: There are multiple different param indenting issues in this file (see here
and get_accChild() below for example), feel free to fix :(

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/accessibility...
chrome/browser/accessibility/browser_accessibility_win.cc:144: result =
target->children_[target->children_.size() - 1];
Nit:

        result = target->children_.back();

(Might want to change the case above to use .front() for parallelism)

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/chromeos/logi...
File chrome/browser/chromeos/login/wizard_accessibility_handler.cc (right):

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/chromeos/logi...
chrome/browser/chromeos/login/wizard_accessibility_handler.cc:433: if
(!inserted.empty() && !deleted.empty()) {
Nit: It seems like this first conditional + arm can just disappear since the
body is the same as the arm below.

Unless this is a bug?

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/download/down...
File chrome/browser/download/download_util.cc (right):

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/download/down...
chrome/browser/download/download_util.cc:116: if (!extension_lower.empty() &&
extension_lower.at(0) == L'{' &&
Nit: at() -> [] (this would be another good change to automate throughout the
codebase)

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/sync/glue/for...
File chrome/browser/sync/glue/foreign_session_tracker.cc (left):

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/sync/glue/for...
chrome/browser/sync/glue/foreign_session_tracker.cc:36: return false;
Heh.  "if (x) return true; else return false;" and its opposite are more good
patterns to do an automated search for.

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/ui/webui/bug_...
File chrome/browser/ui/webui/bug_report_ui.cc (right):

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/ui/webui/bug_...
chrome/browser/ui/webui/bug_report_ui.cc:636: if (!screenshot_path.empty()) {
Nit: No need for {}

http://codereview.chromium.org/6609008/diff/2001/chrome/browser/ui/webui/bug_...
chrome/browser/ui/webui/bug_report_ui.cc:665:
bug_report_->UpdateData(web_ui_->GetProfile()
Nit: While here, want to fix where the commas are?

http://codereview.chromium.org/6609008/diff/2001/chrome_frame/chrome_frame_au...
File chrome_frame/chrome_frame_automation.cc (right):

http://codereview.chromium.org/6609008/diff/2001/chrome_frame/chrome_frame_au...
chrome_frame/chrome_frame_automation.cc:1013: if (!functions_enabled.empty()) {
Nit: No need for {}

http://codereview.chromium.org/6609008/diff/2001/net/base/dnssec_chain_verifi...
File net/base/dnssec_chain_verifier.cc (right):

http://codereview.chromium.org/6609008/diff/2001/net/base/dnssec_chain_verifi...
net/base/dnssec_chain_verifier.cc:735: if (!digest.empty()) {
Nit:

    lookahead[i] = digest.empty();
    if (!digest.empty())
      (*rrdatas)[i] = digest;

http://codereview.chromium.org/6609008/diff/2001/net/url_request/url_request_...
File net/url_request/url_request_throttler_entry.cc (right):

http://codereview.chromium.org/6609008/diff/2001/net/url_request/url_request_...
net/url_request/url_request_throttler_entry.cc:77: if (!send_log_.empty() &&
Nit: This will all fit on one line, then can eliminate {}

http://codereview.chromium.org/6609008/diff/2001/remoting/jingle_glue/jingle_...
File remoting/jingle_glue/jingle_thread.cc (right):

http://codereview.chromium.org/6609008/diff/2001/remoting/jingle_glue/jingle_...
remoting/jingle_glue/jingle_thread.cc:166: if (!msgq_.empty() || fPeekKeep_) {
Nit: No need for {}

http://codereview.chromium.org/6609008/diff/2001/webkit/plugins/npapi/plugin_...
File webkit/plugins/npapi/plugin_lib_mac.mm (right):

http://codereview.chromium.org/6609008/diff/2001/webkit/plugins/npapi/plugin_...
webkit/plugins/npapi/plugin_lib_mac.mm:222: if (have_plugin_descs &&
!plugin_descs.empty())
Nit:

  info->desc = UTF8ToUTF16((have_plugin_descs && !plugin_descs.empty()) ?
      plugin_descs[0] : filename.BaseName().value());

Powered by Google App Engine
This is Rietveld 408576698