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

Side by Side Diff: net/base/dnssec_chain_verifier.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Up 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 "net/base/dnssec_chain_verifier.h" 5 #include "net/base/dnssec_chain_verifier.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/sha2.h" 10 #include "base/sha2.h"
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 725
726 for (unsigned i = 0; i < num_ds; i++) { 726 for (unsigned i = 0; i < num_ds; i++) {
727 uint8 digest_type; 727 uint8 digest_type;
728 base::StringPiece digest; 728 base::StringPiece digest;
729 if (!U8(&digest_type) || 729 if (!U8(&digest_type) ||
730 !VariableLength16(&digest)) { 730 !VariableLength16(&digest)) {
731 return BAD_DATA; 731 return BAD_DATA;
732 } 732 }
733 733
734 digest_types[i] = digest_type; 734 digest_types[i] = digest_type;
735 if (digest.size() > 0) { 735 if (!digest.empty()) {
Peter Kasting 2011/03/03 19:35:53 Nit: lookahead[i] = digest.empty(); if (!
736 (*rrdatas)[i] = digest; 736 (*rrdatas)[i] = digest;
737 lookahead[i] = false; 737 lookahead[i] = false;
738 } else { 738 } else {
739 lookahead[i] = true; 739 lookahead[i] = true;
740 } 740 }
741 } 741 }
742 742
743 base::StringPiece next_entry_key; 743 base::StringPiece next_entry_key;
744 if (!ReadAheadEntryKey(&next_entry_key)) 744 if (!ReadAheadEntryKey(&next_entry_key))
745 return BAD_DATA; 745 return BAD_DATA;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 base::StringPiece name; 804 base::StringPiece name;
805 if (!ReadName(&name)) 805 if (!ReadName(&name))
806 return BAD_DATA; 806 return BAD_DATA;
807 807
808 rrdatas->resize(1); 808 rrdatas->resize(1);
809 (*rrdatas)[0] = name; 809 (*rrdatas)[0] = name;
810 return OK; 810 return OK;
811 } 811 }
812 812
813 } // namespace net 813 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698