Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1036)

Unified Diff: pkg/compiler/lib/src/types/map_type_mask.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/types/forwarding_type_mask.dart ('k') | pkg/compiler/lib/src/types/type_mask.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/map_type_mask.dart
diff --git a/pkg/compiler/lib/src/types/map_type_mask.dart b/pkg/compiler/lib/src/types/map_type_mask.dart
index 52fe4a2a7af77ae05fe8abd7b3207754d71b9d95..b3fbc96fc28ca85b88f40d949d2af28080f0cedd 100644
--- a/pkg/compiler/lib/src/types/map_type_mask.dart
+++ b/pkg/compiler/lib/src/types/map_type_mask.dart
@@ -24,29 +24,20 @@ class MapTypeMask extends ForwardingTypeMask {
// The key type of this map.
final TypeMask keyType;
- MapTypeMask(this.forwardTo,
- this.allocationNode,
- this.allocationElement,
- this.keyType,
- this.valueType);
+ MapTypeMask(this.forwardTo, this.allocationNode, this.allocationElement,
+ this.keyType, this.valueType);
TypeMask nullable() {
return isNullable
? this
- : new MapTypeMask(forwardTo.nullable(),
- allocationNode,
- allocationElement,
- keyType,
- valueType);
+ : new MapTypeMask(forwardTo.nullable(), allocationNode,
+ allocationElement, keyType, valueType);
}
TypeMask nonNullable() {
return isNullable
- ? new MapTypeMask(forwardTo.nonNullable(),
- allocationNode,
- allocationElement,
- keyType,
- valueType)
+ ? new MapTypeMask(forwardTo.nonNullable(), allocationNode,
+ allocationElement, keyType, valueType)
: this;
}
@@ -65,9 +56,7 @@ class MapTypeMask extends ForwardingTypeMask {
TypeMask intersection(TypeMask other, ClassWorld classWorld) {
TypeMask forwardIntersection = forwardTo.intersection(other, classWorld);
if (forwardIntersection.isEmptyOrNull) return forwardIntersection;
- return forwardIntersection.isNullable
- ? nullable()
- : nonNullable();
+ return forwardIntersection.isNullable ? nullable() : nonNullable();
}
TypeMask union(other, ClassWorld classWorld) {
@@ -78,14 +67,12 @@ class MapTypeMask extends ForwardingTypeMask {
} else if (other.isEmptyOrNull) {
return other.isNullable ? this.nullable() : this;
} else if (other.isMap &&
- keyType != null &&
- other.keyType != null &&
- valueType != null &&
- other.valueType != null) {
- TypeMask newKeyType =
- keyType.union(other.keyType, classWorld);
- TypeMask newValueType =
- valueType.union(other.valueType, classWorld);
+ keyType != null &&
+ other.keyType != null &&
+ valueType != null &&
+ other.valueType != null) {
+ TypeMask newKeyType = keyType.union(other.keyType, classWorld);
+ TypeMask newValueType = valueType.union(other.valueType, classWorld);
TypeMask newForwardTo = forwardTo.union(other.forwardTo, classWorld);
return new MapTypeMask(
newForwardTo, null, null, newKeyType, newValueType);
@@ -93,21 +80,23 @@ class MapTypeMask extends ForwardingTypeMask {
assert(other.keyType == classWorld.compiler.typesTask.stringType);
TypeMask newKeyType = keyType.union(other.keyType, classWorld);
TypeMask newValueType =
- other.typeMap.values.fold(keyType, (p,n) => p.union(n, classWorld));
+ other.typeMap.values.fold(keyType, (p, n) => p.union(n, classWorld));
TypeMask newForwardTo = forwardTo.union(other.forwardTo, classWorld);
MapTypeMask newMapTypeMask = new MapTypeMask(
newForwardTo,
allocationNode == other.allocationNode ? allocationNode : null,
- allocationElement == other.allocationElement ? allocationElement
- : null,
- newKeyType, newValueType);
+ allocationElement == other.allocationElement
+ ? allocationElement
+ : null,
+ newKeyType,
+ newValueType);
return newMapTypeMask;
} else {
return forwardTo.union(other, classWorld);
}
}
- bool operator==(other) => super == other;
+ bool operator ==(other) => super == other;
int get hashCode {
return computeHashCode(
« no previous file with comments | « pkg/compiler/lib/src/types/forwarding_type_mask.dart ('k') | pkg/compiler/lib/src/types/type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698