Skip to content

Commit dc16338

Browse files
committed
Implement VersionRange.allowsAll() in terms of allowsLower/Higher()
1 parent 6f5a2f9 commit dc16338

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/src/version_range.dart

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,7 @@ class VersionRange implements Comparable<VersionRange>, VersionConstraint {
137137
}
138138

139139
if (other is VersionRange) {
140-
if (min != null) {
141-
if (other.min == null) return false;
142-
if (min > other.min) return false;
143-
if (min == other.min && !includeMin && other.includeMin) return false;
144-
}
145-
146-
if (max != null) {
147-
if (other.max == null) return false;
148-
if (max < other.max) return false;
149-
if (max == other.max && !includeMax && other.includeMax) return false;
150-
}
151-
152-
return true;
140+
return !allowsLower(other, this) && !allowsHigher(other, this);
153141
}
154142

155143
throw new ArgumentError('Unknown VersionConstraint type $other.');

0 commit comments

Comments
 (0)