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

Side by Side Diff: base/string_util.cc

Issue 6602049: Pure pedantry: Replace all ".size() == 0" with ".empty()". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/string_util.h" 5 #include "base/string_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <ctype.h> 9 #include <ctype.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 797
798 size_t Tokenize(const base::StringPiece& str, 798 size_t Tokenize(const base::StringPiece& str,
799 const base::StringPiece& delimiters, 799 const base::StringPiece& delimiters,
800 std::vector<base::StringPiece>* tokens) { 800 std::vector<base::StringPiece>* tokens) {
801 return TokenizeT(str, delimiters, tokens); 801 return TokenizeT(str, delimiters, tokens);
802 } 802 }
803 803
804 template<typename STR> 804 template<typename STR>
805 static STR JoinStringT(const std::vector<STR>& parts, 805 static STR JoinStringT(const std::vector<STR>& parts,
806 typename STR::value_type sep) { 806 typename STR::value_type sep) {
807 if (parts.size() == 0) return STR(); 807 if (parts.empty()) return STR();
Peter Kasting 2011/03/02 00:02:42 Nit: Style: return goes on separate line
808 808
809 STR result(parts[0]); 809 STR result(parts[0]);
810 typename std::vector<STR>::const_iterator iter = parts.begin(); 810 typename std::vector<STR>::const_iterator iter = parts.begin();
Peter Kasting 2011/03/02 00:02:42 Nit: While here: STR result(parts[0]); for (s
811 ++iter; 811 ++iter;
812 812
813 for (; iter != parts.end(); ++iter) { 813 for (; iter != parts.end(); ++iter) {
814 result += sep; 814 result += sep;
815 result += *iter; 815 result += *iter;
816 } 816 }
817 817
818 return result; 818 return result;
819 } 819 }
820 820
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 } 1087 }
1088 1088
1089 } // namespace 1089 } // namespace
1090 1090
1091 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { 1091 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
1092 return lcpyT<char>(dst, src, dst_size); 1092 return lcpyT<char>(dst, src, dst_size);
1093 } 1093 }
1094 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { 1094 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
1095 return lcpyT<wchar_t>(dst, src, dst_size); 1095 return lcpyT<wchar_t>(dst, src, dst_size);
1096 } 1096 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698