Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
99b5262b
Unverified
Commit
99b5262b
authored
Jan 20, 2023
by
Michael Goderbauer
Committed by
GitHub
Jan 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary null checks in dev/tools (#118845)
parent
98c18ca9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
31 deletions
+9
-31
dartdoc.dart
dev/tools/dartdoc.dart
+0
-2
android_code_gen.dart
dev/tools/gen_keycodes/lib/android_code_gen.dart
+2
-4
keyboard_maps_code_gen.dart
dev/tools/gen_keycodes/lib/keyboard_maps_code_gen.dart
+4
-10
utils.dart
dev/tools/gen_keycodes/lib/utils.dart
+0
-3
gen_localizations.dart
dev/tools/localization/bin/gen_localizations.dart
+0
-4
localizations_utils.dart
dev/tools/localization/localizations_utils.dart
+1
-6
vitool_test.dart
dev/tools/vitool/test/vitool_test.dart
+2
-2
No files found.
dev/tools/dartdoc.dart
View file @
99b5262b
...
...
@@ -581,8 +581,6 @@ Iterable<String> libraryRefs() sync* {
}
void
printStream
(
Stream
<
List
<
int
>>
stream
,
{
String
prefix
=
''
,
List
<
Pattern
>
filter
=
const
<
Pattern
>[]
})
{
assert
(
prefix
!=
null
);
assert
(
filter
!=
null
);
stream
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
...
...
dev/tools/gen_keycodes/lib/android_code_gen.dart
View file @
99b5262b
...
...
@@ -31,12 +31,10 @@ class AndroidCodeGenerator extends PlatformCodeGenerator {
String
get
_androidScanCodeMap
{
final
StringBuffer
androidScanCodeMap
=
StringBuffer
();
for
(
final
PhysicalKeyEntry
entry
in
keyData
.
entries
)
{
if
(
entry
.
androidScanCodes
!=
null
)
{
for
(
final
int
code
in
entry
.
androidScanCodes
.
cast
<
int
>())
{
androidScanCodeMap
.
writeln
(
' put(
${toHex(code, digits: 10)}
L,
${toHex(entry.usbHidCode, digits: 10)}
L); //
${entry.constantName}
'
);
}
}
}
return
androidScanCodeMap
.
toString
().
trimRight
();
}
...
...
dev/tools/gen_keycodes/lib/keyboard_maps_code_gen.dart
View file @
99b5262b
...
...
@@ -144,12 +144,10 @@ class KeyboardMapsCodeGenerator extends BaseCodeGenerator {
String
get
_androidScanCodeMap
{
final
OutputLines
<
int
>
lines
=
OutputLines
<
int
>(
'Android scancode map'
);
for
(
final
PhysicalKeyEntry
entry
in
keyData
.
entries
)
{
if
(
entry
.
androidScanCodes
!=
null
)
{
for
(
final
int
code
in
entry
.
androidScanCodes
)
{
lines
.
add
(
code
,
'
$code
: PhysicalKeyboardKey.
${entry.constantName}
,'
);
}
}
}
return
lines
.
sortedJoin
().
trimRight
();
}
...
...
@@ -296,10 +294,8 @@ class KeyboardMapsCodeGenerator extends BaseCodeGenerator {
String
get
_fuchsiaHidCodeMap
{
final
StringBuffer
fuchsiaScanCodeMap
=
StringBuffer
();
for
(
final
PhysicalKeyEntry
entry
in
keyData
.
entries
)
{
if
(
entry
.
usbHidCode
!=
null
)
{
fuchsiaScanCodeMap
.
writeln
(
'
${toHex(entry.usbHidCode)}
: PhysicalKeyboardKey.
${entry.constantName}
,'
);
}
}
return
fuchsiaScanCodeMap
.
toString
().
trimRight
();
}
...
...
@@ -328,10 +324,8 @@ class KeyboardMapsCodeGenerator extends BaseCodeGenerator {
String
get
_webNumpadMap
{
final
OutputLines
<
String
>
lines
=
OutputLines
<
String
>(
'Web numpad map'
);
for
(
final
LogicalKeyEntry
entry
in
_numpadLogicalKeyData
)
{
if
(
entry
.
name
!=
null
)
{
lines
.
add
(
entry
.
name
,
" '
${entry.name}
': LogicalKeyboardKey.
${entry.constantName}
,"
);
}
}
return
lines
.
sortedJoin
().
trimRight
();
}
...
...
dev/tools/gen_keycodes/lib/utils.dart
View file @
99b5262b
...
...
@@ -153,9 +153,6 @@ String wrapString(String input, {required String prefix}) {
///
/// An null list is considered a list with length 0.
void
zipStrict
<
T1
,
T2
>(
Iterable
<
T1
>
list1
,
Iterable
<
T2
>
list2
,
void
Function
(
T1
,
T2
)
fn
)
{
if
(
list1
==
null
&&
list2
==
null
)
{
return
;
}
assert
(
list1
.
length
==
list2
.
length
);
final
Iterator
<
T1
>
it1
=
list1
.
iterator
;
final
Iterator
<
T2
>
it2
=
list2
.
iterator
;
...
...
dev/tools/localization/bin/gen_localizations.dart
View file @
99b5262b
...
...
@@ -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
);
...
...
dev/tools/localization/localizations_utils.dart
View file @
99b5262b
...
...
@@ -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
);
}
...
...
dev/tools/vitool/test/vitool_test.dart
View file @
99b5262b
...
...
@@ -614,7 +614,7 @@ class PathMatcher extends Matcher {
@override
bool
matches
(
dynamic
item
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
if
(
item
==
null
||
actual
==
null
)
{
if
(
item
==
null
)
{
return
item
==
actual
;
}
...
...
@@ -666,7 +666,7 @@ class PathAnimationMatcher extends Matcher {
@override
bool
matches
(
dynamic
item
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
if
(
item
==
null
||
expected
==
null
)
{
if
(
item
==
null
)
{
return
item
==
expected
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment