Bug 1626786 - Use .empty() instead of .size(). r=sylvestre
authorjayati <gaurijove@gmail.com>
Fri, 03 Apr 2020 13:56:59 +0000
changeset 521985 cf48e59e88dec9bd29a53e2ed1a836537a439426
parent 521984 0d202ecafbcb30197f514b481bf1a0de897b0a52
child 521986 16ee5dd004d3c872bbb5a7d81be4a23c6309b05a
push id37280
push useropoprus@mozilla.com
push dateFri, 03 Apr 2020 21:40:10 +0000
treeherdermozilla-central@cf48e59e88de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1626786
milestone76.0a1
first release with
nightly linux32
cf48e59e88de / 76.0a1 / 20200403214010 / files
nightly linux64
cf48e59e88de / 76.0a1 / 20200403214010 / files
nightly mac
cf48e59e88de / 76.0a1 / 20200403214010 / files
nightly win32
cf48e59e88de / 76.0a1 / 20200403214010 / files
nightly win64
cf48e59e88de / 76.0a1 / 20200403214010 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1626786 - Use .empty() instead of .size(). r=sylvestre Differential Revision: https://phabricator.services.mozilla.com/D69502
js/src/builtin/intl/LanguageTag.cpp
--- a/js/src/builtin/intl/LanguageTag.cpp
+++ b/js/src/builtin/intl/LanguageTag.cpp
@@ -661,17 +661,17 @@ bool LanguageTag::canonicalizeUnicodeExt
   return true;
 }
 
 template <class Buffer>
 static bool LanguageTagToString(JSContext* cx, const LanguageTag& tag,
                                 Buffer& sb) {
   auto appendSubtag = [&sb](const auto& subtag) {
     auto span = subtag.span();
-    MOZ_ASSERT(span.size() > 0);
+    MOZ_ASSERT(!span.empty());
     return sb.append(span.data(), span.size());
   };
 
   auto appendSubtagZ = [&sb](const char* subtag) {
     MOZ_ASSERT(strlen(subtag) > 0);
     return sb.append(subtag, strlen(subtag));
   };
 
@@ -916,17 +916,17 @@ static bool HasLikelySubtags(LikelySubta
 
 // Create an ICU locale ID from the given language tag.
 static bool CreateLocaleForLikelySubtags(const LanguageTag& tag,
                                          LocaleId& locale) {
   MOZ_ASSERT(locale.length() == 0);
 
   auto appendSubtag = [&locale](const auto& subtag) {
     auto span = subtag.span();
-    MOZ_ASSERT(span.size() > 0);
+    MOZ_ASSERT(!span.empty());
     return locale.append(span.data(), span.size());
   };
 
   // Append the language subtag.
   if (!appendSubtag(tag.language())) {
     return false;
   }