From 4c98db35cdd001ce1585bc703375c92ec3ebea9b Mon Sep 17 00:00:00 2001 From: "jhawkins@chromium.org" Date: Thu, 1 Oct 2009 19:12:30 +0000 Subject: Coverity: Remove a check for < 0 on an unsigned int. CID=4546 BUG=none TEST=none Review URL: http://codereview.chromium.org/249047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27753 0039d316-1c4b-4281-b951-d872f2087c98 --- app/l10n_util.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/l10n_util.h') diff --git a/app/l10n_util.h b/app/l10n_util.h index 5e50d6e..be15a4e 100644 --- a/app/l10n_util.h +++ b/app/l10n_util.h @@ -8,13 +8,13 @@ #ifndef APP_L10N_UTIL_H_ #define APP_L10N_UTIL_H_ -#include "build/build_config.h" - #include #include #include #include +#include "build/build_config.h" + #include "base/basictypes.h" #include "base/logging.h" #include "base/scoped_ptr.h" @@ -327,12 +327,12 @@ void SortStringsUsingMethod(const std::wstring& locale, scoped_ptr collator(icu::Collator::createInstance(loc, error)); if (U_FAILURE(error)) { sort(elements->begin(), elements->end(), - StringMethodComparator(method)); + StringMethodComparator(method)); return; } std::sort(elements->begin(), elements->end(), - StringMethodComparatorWithCollator(collator.get(), method)); + StringMethodComparatorWithCollator(collator.get(), method)); } // Compares two elements' string keys and returns true if the first element's @@ -377,7 +377,7 @@ void SortVectorWithStringKey(const std::string& locale, unsigned int begin_index, unsigned int end_index, bool needs_stable_sort) { - DCHECK(begin_index >= 0 && begin_index < end_index && + DCHECK(begin_index < end_index && end_index <= static_cast(elements->size())); UErrorCode error = U_ZERO_ERROR; icu::Locale loc(locale.c_str()); -- cgit v1.1