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

Side by Side Diff: base/string_util.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits 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
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/browser/accessibility/browser_accessibility_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.empty()) return STR(); 807 if (parts.empty())
808 return STR();
808 809
809 STR result(parts[0]); 810 STR result(parts[0]);
810 typename std::vector<STR>::const_iterator iter = parts.begin(); 811 typename std::vector<STR>::const_iterator iter = parts.begin();
811 ++iter; 812 ++iter;
812 813
813 for (; iter != parts.end(); ++iter) { 814 for (; iter != parts.end(); ++iter) {
814 result += sep; 815 result += sep;
815 result += *iter; 816 result += *iter;
816 } 817 }
817 818
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 } 1088 }
1088 1089
1089 } // namespace 1090 } // namespace
1090 1091
1091 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { 1092 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
1092 return lcpyT<char>(dst, src, dst_size); 1093 return lcpyT<char>(dst, src, dst_size);
1093 } 1094 }
1094 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { 1095 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
1095 return lcpyT<wchar_t>(dst, src, dst_size); 1096 return lcpyT<wchar_t>(dst, src, dst_size);
1096 } 1097 }
OLDNEW
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/browser/accessibility/browser_accessibility_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698