Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Remove unnecessary null checks in ‘dev/conductor’ (#118843)
Browse files Browse the repository at this point in the history
* Remove unnecessary null checks in dev/conductor

* review
  • Loading branch information
goderbauer committed Jan 20, 2023
1 parent 9acf34d commit ec51d32
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dev/conductor/core/lib/src/globals.dart
Expand Up @@ -126,7 +126,7 @@ List<String> getValuesFromEnvOrArgs(
if (env[envName] != null && env[envName] != '') {
return env[envName]!.split(',');
}
final List<String> argValues = argResults[name] as List<String>;
final List<String>? argValues = argResults[name] as List<String>?;
if (argValues != null) {
return argValues;
}
Expand Down
2 changes: 0 additions & 2 deletions dev/conductor/core/lib/src/repository.dart
Expand Up @@ -28,7 +28,6 @@ class Remote {
required RemoteName name,
required this.url,
}) : _name = name,
assert(url != null),
assert(url != '');

factory Remote.mirror(String url) {
Expand Down Expand Up @@ -241,7 +240,6 @@ abstract class Repository {

/// The URL of the remote named [remoteName].
Future<String> remoteUrl(String remoteName) async {
assert(remoteName != null);
return git.getOutput(
<String>['remote', 'get-url', remoteName],
'verify the URL of the $remoteName remote',
Expand Down
4 changes: 1 addition & 3 deletions dev/conductor/core/lib/src/state.dart
Expand Up @@ -86,8 +86,7 @@ String presentState(pb.ConductorState state) {
} else {
buffer.writeln('0 Engine cherrypicks.');
}
if (state.engine.dartRevision != null &&
state.engine.dartRevision.isNotEmpty) {
if (state.engine.dartRevision.isNotEmpty) {
buffer.writeln('New Dart SDK revision: ${state.engine.dartRevision}');
}
buffer.writeln('Framework Repo');
Expand Down Expand Up @@ -271,7 +270,6 @@ String githubAccount(String remoteUrl) {
/// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is
/// passed as an argument, as there is no next phase.
ReleasePhase getNextPhase(ReleasePhase currentPhase) {
assert(currentPhase != null);
final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1);
if (nextPhase == null) {
throw globals.ConductorException('There is no next ReleasePhase!');
Expand Down
1 change: 0 additions & 1 deletion dev/conductor/core/lib/src/version.dart
Expand Up @@ -77,7 +77,6 @@ class Version {
/// `flutter --version` and match one of `stablePattern`, `developmentPattern`
/// and `latestPattern`.
factory Version.fromString(String versionString) {
assert(versionString != null);

versionString = versionString.trim();
// stable tag
Expand Down

0 comments on commit ec51d32

Please sign in to comment.