summaryrefslogtreecommitdiffstats
path: root/net
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 /net
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 'net')
-rw-r--r--net/base/dnssec_chain_verifier.cc6
-rw-r--r--net/base/x509_certificate.cc2
-rw-r--r--net/base/x509_certificate_mac.cc2
-rw-r--r--net/disk_cache/mem_entry_impl.cc2
-rw-r--r--net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp2
-rw-r--r--net/tools/flip_server/split.cc2
-rw-r--r--net/tools/tld_cleanup/tld_cleanup.cc6
7 files changed, 11 insertions, 11 deletions
diff --git a/net/base/dnssec_chain_verifier.cc b/net/base/dnssec_chain_verifier.cc
index e6d31ee..6e68365 100644
--- a/net/base/dnssec_chain_verifier.cc
+++ b/net/base/dnssec_chain_verifier.cc
@@ -489,7 +489,7 @@ bool DNSSECChainVerifier::ReadDNSKEYs(std::vector<base::StringPiece>* out,
base::StringPiece key;
if (!VariableLength16(&key))
return false;
- if (key.size() == 0) {
+ if (key.empty()) {
if (!is_root)
return false;
key = base::StringPiece(reinterpret_cast<const char*>(kRootKey),
@@ -597,7 +597,7 @@ DNSSECChainVerifier::Error DNSSECChainVerifier::EnterZone(
if (!ReadAheadKey(&key, entry_key))
return BAD_DATA;
- if (zone.size() == 1 && key.size() == 0) {
+ if (zone.size() == 1 && key.empty()) {
// If a key is omitted in the root zone then it's the root key.
key = base::StringPiece(reinterpret_cast<const char*>(kRootKey),
sizeof(kRootKey));
@@ -609,7 +609,7 @@ DNSSECChainVerifier::Error DNSSECChainVerifier::EnterZone(
if (!ReadDNSKEYs(&dnskeys, zone.size() == 1))
return BAD_DATA;
- if (sig.size() == 0) {
+ if (sig.empty()) {
// An omitted signature on the keys means that only the entry key is used.
if (dnskeys.size() > 1 || entry_key != 0)
return BAD_DATA;
diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc
index 6469537..8b7014b 100644
--- a/net/base/x509_certificate.cc
+++ b/net/base/x509_certificate.cc
@@ -184,7 +184,7 @@ static X509Certificate::OSCertHandle CreateOSCert(base::StringPiece der_cert) {
// static
X509Certificate* X509Certificate::CreateFromDERCertChain(
const std::vector<base::StringPiece>& der_certs) {
- if (der_certs.size() == 0)
+ if (der_certs.empty())
return NULL;
X509Certificate::OSCertHandles intermediate_ca_certs;
diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc
index 3cc1e08..f9023fd 100644
--- a/net/base/x509_certificate_mac.cc
+++ b/net/base/x509_certificate_mac.cc
@@ -544,7 +544,7 @@ X509Certificate* X509Certificate::CreateSelfSigned(
cssm_subject_names.push_back(cssm_subject_name);
}
- if (cssm_subject_names.size() == 0) {
+ if (cssm_subject_names.empty()) {
DLOG(ERROR) << "cssm_subject_names.size() == 0. Input: " << subject;
return NULL;
}
diff --git a/net/disk_cache/mem_entry_impl.cc b/net/disk_cache/mem_entry_impl.cc
index 30599f4..2b37f36 100644
--- a/net/disk_cache/mem_entry_impl.cc
+++ b/net/disk_cache/mem_entry_impl.cc
@@ -75,7 +75,7 @@ void MemEntryImpl::InternalDoom() {
if (i->second != this)
i->second->Doom();
}
- DCHECK(children_->size() == 0);
+ DCHECK(children_->empty());
}
} else {
// If this is a child entry, detach it from the parent.
diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
index fcaff60..0cf9562 100644
--- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
+++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
@@ -277,7 +277,7 @@ int nsPKCS12Blob_Import(PK11SlotInfo* slot,
// zero length SECItem.
// We try both variations, zero length item and empty string,
// without giving a user prompt when trying the different empty password flavors.
- if (rv == net::ERR_PKCS12_IMPORT_BAD_PASSWORD && password.size() == 0) {
+ if (rv == net::ERR_PKCS12_IMPORT_BAD_PASSWORD && password.empty()) {
rv = nsPKCS12Blob_ImportHelper(pkcs12_data, pkcs12_len, password, true,
slot);
}
diff --git a/net/tools/flip_server/split.cc b/net/tools/flip_server/split.cc
index 6ab50cf..2d8659a 100644
--- a/net/tools/flip_server/split.cc
+++ b/net/tools/flip_server/split.cc
@@ -19,7 +19,7 @@ void SplitStringPieceToVector(const base::StringPiece& full,
std::vector<base::StringPiece>* vec,
bool omit_empty_strings) {
vec->clear();
- if (full.size() == 0 || delim[0] == '\0')
+ if (full.empty() || delim[0] == '\0')
return;
if (delim[1] == '\0') {
diff --git a/net/tools/tld_cleanup/tld_cleanup.cc b/net/tools/tld_cleanup/tld_cleanup.cc
index be723c4..7a8aea8f 100644
--- a/net/tools/tld_cleanup/tld_cleanup.cc
+++ b/net/tools/tld_cleanup/tld_cleanup.cc
@@ -106,13 +106,13 @@ NormalizeResult NormalizeRule(std::string* domain, Rule* rule) {
// Strip single leading and trailing dots.
if (domain->at(0) == '.')
domain->erase(0, 1);
- if (domain->size() == 0) {
+ if (domain->empty()) {
LOG(WARNING) << "Ignoring empty rule";
return kWarning;
}
if (domain->at(domain->size() - 1) == '.')
domain->erase(domain->size() - 1, 1);
- if (domain->size() == 0) {
+ if (domain->empty()) {
LOG(WARNING) << "Ignoring empty rule";
return kWarning;
}
@@ -126,7 +126,7 @@ NormalizeResult NormalizeRule(std::string* domain, Rule* rule) {
domain->erase(0, 2);
rule->wildcard = true;
}
- if (domain->size() == 0) {
+ if (domain->empty()) {
LOG(WARNING) << "Ignoring empty rule";
return kWarning;
}