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

Side by Side Diff: o3d/utils/cross/text_reader.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 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 30 matching lines...) Expand all
41 static const char kCarriageReturn = '\r'; 41 static const char kCarriageReturn = '\r';
42 } 42 }
43 43
44 TextReader::TextReader() { 44 TextReader::TextReader() {
45 } 45 }
46 46
47 TextReader::~TextReader() { 47 TextReader::~TextReader() {
48 } 48 }
49 49
50 int TextReader::TestForEndOfLine(const std::string& eol) { 50 int TextReader::TestForEndOfLine(const std::string& eol) {
51 if (eol.size() == 0) { 51 if (eol.empty()) {
Peter Kasting 2011/03/02 00:02:42 Nit: Eliminate anonymous namespace of consts and c
52 return 0; 52 return 0;
53 } 53 }
54 if (eol[0] == kLinefeed) { 54 if (eol[0] == kLinefeed) {
55 return 1; 55 return 1;
56 } 56 }
57 if (eol[0] == kCarriageReturn) { 57 if (eol[0] == kCarriageReturn) {
58 if (eol.size() > 1 && eol[1] == kLinefeed) { 58 if (eol.size() > 1 && eol[1] == kLinefeed) {
59 return 2; 59 return 2;
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
63 } 63 }
64 return 0; 64 return 0;
65 } 65 }
66 } // end namespace o3d 66 } // end namespace o3d
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698