Remove unnecessary null checks in dev/tools (#118845)

This commit is contained in:
Michael Goderbauer
2023-01-19 20:06:09 -08:00
committed by GitHub
parent 98c18ca93f
commit 99b5262b21
7 changed files with 9 additions and 31 deletions

View File

@@ -71,12 +71,8 @@ String generateArbBasedLocalizationSubclasses({
required String supportedLanguagesConstant,
required String supportedLanguagesDocMacro,
}) {
assert(localeToResources != null);
assert(localeToResourceAttributes != null);
assert(generatedClassPrefix.isNotEmpty);
assert(baseClass.isNotEmpty);
assert(generateHeader != null);
assert(generateConstructor != null);
assert(factoryName.isNotEmpty);
assert(factoryDeclaration.isNotEmpty);
assert(factoryArguments.isNotEmpty);

View File

@@ -51,7 +51,7 @@ class LocaleInfo implements Comparable<LocaleInfo> {
scriptCode = codes[1].length > codes[2].length ? codes[1] : codes[2];
countryCode = codes[1].length < codes[2].length ? codes[1] : codes[2];
}
assert(codes[0] != null && codes[0].isNotEmpty);
assert(codes[0].isNotEmpty);
assert(countryCode == null || countryCode.isNotEmpty);
assert(scriptCode == null || scriptCode.isNotEmpty);
@@ -151,10 +151,6 @@ void loadMatchingArbsIntoBundleMaps({
required Map<LocaleInfo, Map<String, String>> localeToResources,
required Map<LocaleInfo, Map<String, dynamic>> localeToResourceAttributes,
}) {
assert(directory != null);
assert(filenamePattern != null);
assert(localeToResources != null);
assert(localeToResourceAttributes != null);
/// Set that holds the locales that were assumed from the existing locales.
///
@@ -214,7 +210,6 @@ void loadMatchingArbsIntoBundleMaps({
}
void exitWithError(String errorMessage) {
assert(errorMessage != null);
stderr.writeln('fatal: $errorMessage');
exit(1);
}