-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eval cond perf #6859
Eval cond perf #6859
Changes from 1 commit
e02b3d9
64354ff
762ac1d
f9456c4
16a30b3
6e4c0d4
2aac6e2
0134385
625fd3f
62760c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,37 @@ internal override bool CanVersionEvaluate(ConditionEvaluator.IConditionEvaluatio | |
return Version.TryParse(GetExpandedValue(state), out _); | ||
} | ||
|
||
internal override bool TryBoolEvaluate(ConditionEvaluator.IConditionEvaluationState state, out bool result) | ||
{ | ||
return ConversionUtilities.TryConvertStringToBool(GetExpandedValue(state), out result); | ||
} | ||
|
||
internal override bool TryNumericEvaluate(ConditionEvaluator.IConditionEvaluationState state, out double result) | ||
{ | ||
if (ShouldBeTreatedAsVisualStudioVersion(state)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or alternately should we entirely remove the non- |
||
{ | ||
result = ConversionUtilities.ConvertDecimalOrHexToDouble(MSBuildConstants.CurrentVisualStudioVersion); | ||
return true; | ||
} | ||
else | ||
{ | ||
return ConversionUtilities.TryConvertDecimalOrHexToDouble(GetExpandedValue(state), out result); | ||
} | ||
} | ||
|
||
internal override bool TryVersionEvaluate(ConditionEvaluator.IConditionEvaluationState state, out Version result) | ||
{ | ||
if (ShouldBeTreatedAsVisualStudioVersion(state)) | ||
{ | ||
result = Version.Parse(MSBuildConstants.CurrentVisualStudioVersion); | ||
return true; | ||
} | ||
else | ||
{ | ||
return Version.TryParse(GetExpandedValue(state), out result); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if this node evaluates to an empty string, | ||
/// otherwise false. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice comment 👍🏻