Skip to content

Commit

Permalink
update after comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-pekacki authored and pawelbaran committed Jul 5, 2022
1 parent 1c3ece6 commit 2e24acd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Revit_Core_Engine/Query/Passes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public static bool Passes(this Parameter parameter, FilterByParameterNumber requ
return false;


double paramValue;
double paramValue = double.NaN;
if (parameter.HasValue)
{
if (parameter.StorageType == StorageType.Double)
Expand All @@ -269,10 +269,6 @@ public static bool Passes(this Parameter parameter, FilterByParameterNumber requ
else
return false;
}
else
{
paramValue = double.NaN;
}

double comparisonValue = request.Value;
double comparisonTolerance = request.Tolerance;
Expand All @@ -286,7 +282,7 @@ public static bool Passes(this Parameter parameter, FilterByParameterNumber requ
switch (request.NumberComparisonType)
{
case NumberComparisonType.Equal:
return Math.Abs(paramValue - comparisonValue) <= comparisonTolerance;
return Math.Abs(paramValue - comparisonValue) <= comparisonTolerance || (double.IsNaN(paramValue) && double.IsNaN(comparisonValue));
case NumberComparisonType.Greater:
return paramValue - comparisonValue > comparisonTolerance;
case NumberComparisonType.GreaterOrEqual:
Expand Down

0 comments on commit 2e24acd

Please sign in to comment.