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

Side by Side Diff: chrome/browser/history/query_parser.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 | « chrome/browser/history/history_types.cc ('k') | chrome/browser/importer/firefox2_importer.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 "chrome/browser/history/query_parser.h" 5 #include "chrome/browser/history/query_parser.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/break_iterator.h" 9 #include "base/i18n/break_iterator.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 } 239 }
240 return false; 240 return false;
241 } 241 }
242 242
243 QueryParser::QueryParser() { 243 QueryParser::QueryParser() {
244 } 244 }
245 245
246 // static 246 // static
247 bool QueryParser::IsWordLongEnoughForPrefixSearch(const string16& word) { 247 bool QueryParser::IsWordLongEnoughForPrefixSearch(const string16& word) {
248 DCHECK(word.size() > 0); 248 DCHECK(!word.empty());
249 size_t minimum_length = 3; 249 size_t minimum_length = 3;
250 // We intentionally exclude Hangul Jamos (both Conjoining and compatibility) 250 // We intentionally exclude Hangul Jamos (both Conjoining and compatibility)
251 // because they 'behave like' Latin letters. Moreover, we should 251 // because they 'behave like' Latin letters. Moreover, we should
252 // normalize the former before reaching here. 252 // normalize the former before reaching here.
253 if (0xAC00 <= word[0] && word[0] <= 0xD7A3) 253 if (0xAC00 <= word[0] && word[0] <= 0xD7A3)
254 minimum_length = 2; 254 minimum_length = 2;
255 return word.size() >= minimum_length; 255 return word.size() >= minimum_length;
256 } 256 }
257 257
258 // Returns true if the character is considered a quote. 258 // Returns true if the character is considered a quote.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if (iter.IsWord()) { 377 if (iter.IsWord()) {
378 string16 word = iter.GetString(); 378 string16 word = iter.GetString();
379 if (!word.empty()) { 379 if (!word.empty()) {
380 words->push_back(QueryWord()); 380 words->push_back(QueryWord());
381 words->back().word = word; 381 words->back().word = word;
382 words->back().position = iter.prev(); 382 words->back().position = iter.prev();
383 } 383 }
384 } 384 }
385 } 385 }
386 } 386 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_types.cc ('k') | chrome/browser/importer/firefox2_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698