Skip to content

Commit 0b69e3b

Browse files
committed
use existing GetInfo(quantityType) method
- had missed this one
1 parent 4dcc1ac commit 0b69e3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

UnitsNet/UnitSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public UnitSystem WithDefaultUnit(QuantityType quantityType, UnitInfo defaultUni
155155
if (quantityType == QuantityType.Undefined) // redundant with the following test
156156
throw new ArgumentException("Quantity type can not be undefined.", nameof(quantityType));
157157

158-
if (defaultUnitInfo != null && !Quantity.Infos.Any(x => x.QuantityType == quantityType && x.UnitInfos.Contains(defaultUnitInfo)))
158+
if (defaultUnitInfo != null && !Quantity.GetInfo(quantityType).UnitInfos.Contains(defaultUnitInfo))
159159
throw new ArgumentException("The unit provided was not found in the list of units for the specified quantity type");
160160

161161
var newBaseUnits = baseUnits ?? BaseUnits;

0 commit comments

Comments
 (0)