Reland "if chains → switch expressions" (#148634)
I did a goof a while back:

Now that [the bug is fixed](e9d403541f), I think we're good to re-implement the if-chains cleanup!
Related:
- https://github.com/flutter/flutter/pull/147793
- https://github.com/flutter/flutter/pull/148556
- https://github.com/flutter/flutter/issues/148548
This commit is contained in:
@@ -255,16 +255,14 @@ class StartContext extends Context {
|
||||
if (atBranchPoint) {
|
||||
return ReleaseType.BETA_INITIAL;
|
||||
}
|
||||
|
||||
if (releaseChannel == 'stable') {
|
||||
if (lastVersion.type == VersionType.stable) {
|
||||
return ReleaseType.STABLE_HOTFIX;
|
||||
} else {
|
||||
return ReleaseType.STABLE_INITIAL;
|
||||
}
|
||||
if (releaseChannel != 'stable') {
|
||||
return ReleaseType.BETA_HOTFIX;
|
||||
}
|
||||
|
||||
return ReleaseType.BETA_HOTFIX;
|
||||
return switch (lastVersion.type) {
|
||||
VersionType.stable => ReleaseType.STABLE_HOTFIX,
|
||||
VersionType.development || VersionType.gitDescribe || VersionType.latest => ReleaseType.STABLE_INITIAL,
|
||||
};
|
||||
}
|
||||
|
||||
Future<void> run() async {
|
||||
|
||||
Reference in New Issue
Block a user