summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 00:03:18 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 00:03:18 +0000
commitf6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3 (patch)
tree840cfc698d0c1287ef8802ca9a564ae7abdd0f13 /base
parent9ad77099038a76c96f6c4d162fb0706426215a5f (diff)
downloadchromium_src-f6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3.zip
chromium_src-f6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3.tar.gz
chromium_src-f6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3.tar.bz2
Pure pedantry: Replace all ".size() == 0" with ".empty()".
BUG=carnitas TEST=compiles; existing unit tests. Review URL: http://codereview.chromium.org/6602049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/command_line_unittest.cc2
-rw-r--r--base/crypto/encryptor_nss.cc2
-rw-r--r--base/file_path.cc2
-rw-r--r--base/file_util_posix.cc2
-rw-r--r--base/mime_util_xdg.cc2
-rw-r--r--base/process_util_posix.cc2
-rw-r--r--base/string_util.cc2
7 files changed, 7 insertions, 7 deletions
diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc
index 6fd6440..de8e414 100644
--- a/base/command_line_unittest.cc
+++ b/base/command_line_unittest.cc
@@ -109,7 +109,7 @@ TEST(CommandLineTest, EmptyString) {
EXPECT_TRUE(cl.GetProgram().empty());
#elif defined(OS_POSIX)
CommandLine cl(0, NULL);
- EXPECT_TRUE(cl.argv().size() == 0);
+ EXPECT_EQ(0U, cl.argv().size());
#endif
EXPECT_EQ(0U, cl.args().size());
}
diff --git a/base/crypto/encryptor_nss.cc b/base/crypto/encryptor_nss.cc
index 6256d7a..3b9f7f3 100644
--- a/base/crypto/encryptor_nss.cc
+++ b/base/crypto/encryptor_nss.cc
@@ -85,7 +85,7 @@ bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
}
bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) {
- if (ciphertext.size() == 0)
+ if (ciphertext.empty())
return false;
ScopedPK11Context context(PK11_CreateContextBySymKey(CKM_AES_CBC_PAD,
diff --git a/base/file_path.cc b/base/file_path.cc
index 907a412..32217f2 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -251,7 +251,7 @@ bool FilePath::AppendRelativePath(const FilePath& child,
if (parent_components.size() >= child_components.size())
return false;
- if (parent_components.size() == 0)
+ if (parent_components.empty())
return false;
std::vector<StringType>::const_iterator parent_comp =
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 7e4c3a9..8df0d27 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -633,7 +633,7 @@ FileEnumerator::FileEnumerator(const FilePath& root_path,
// The Windows version of this code appends the pattern to the root_path,
// potentially only matching against items in the top-most directory.
// Do the same here.
- if (pattern.size() == 0)
+ if (pattern.empty())
pattern_ = FilePath::StringType();
pending_paths_.push(root_path);
}
diff --git a/base/mime_util_xdg.cc b/base/mime_util_xdg.cc
index 5215d01..4dd7a3e 100644
--- a/base/mime_util_xdg.cc
+++ b/base/mime_util_xdg.cc
@@ -525,7 +525,7 @@ FilePath LookupIconInDefaultTheme(const std::string& icon_name, int size) {
EnsureUpdated();
MimeUtilConstants* constants = MimeUtilConstants::GetInstance();
std::map<std::string, IconTheme*>* icon_themes = constants->icon_themes_;
- if (icon_themes->size() == 0)
+ if (icon_themes->empty())
InitDefaultThemes();
FilePath icon_path;
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 9a5f5a7..cf93c05 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -451,7 +451,7 @@ char** AlterEnvironment(const environment_vector& changes,
// Now handle new elements
for (environment_vector::const_iterator
j = changes.begin(); j != changes.end(); j++) {
- if (j->second.size() == 0)
+ if (j->second.empty())
continue;
bool found = false;
diff --git a/base/string_util.cc b/base/string_util.cc
index ce12705..4af3ed9 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -804,7 +804,7 @@ size_t Tokenize(const base::StringPiece& str,
template<typename STR>
static STR JoinStringT(const std::vector<STR>& parts,
typename STR::value_type sep) {
- if (parts.size() == 0) return STR();
+ if (parts.empty()) return STR();
STR result(parts[0]);
typename std::vector<STR>::const_iterator iter = parts.begin();