Skip to content

Commit

Permalink
Add fast paths for version comparison intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
nguerrera committed Nov 14, 2019
1 parent f3a0925 commit a54c5be
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/Build/Evaluation/Expander.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3865,6 +3865,54 @@ private bool TryExecuteWellKnownFunction(out object returnVal, object objectInst
return true;
}
}
else if (string.Equals(_methodMethodName, nameof(IntrinsicFunctions.VersionEquals), StringComparison.OrdinalIgnoreCase))
{
if (TryGetArgs(args, out string arg0, out string arg1))
{
returnVal = IntrinsicFunctions.VersionEquals(arg0, arg1);
return true;
}
}
else if (string.Equals(_methodMethodName, nameof(IntrinsicFunctions.VersionNotEquals), StringComparison.OrdinalIgnoreCase))
{
if (TryGetArgs(args, out string arg0, out string arg1))
{
returnVal = IntrinsicFunctions.VersionNotEquals(arg0, arg1);
return true;
}
}
else if (string.Equals(_methodMethodName, nameof(IntrinsicFunctions.VersionGreaterThan), StringComparison.OrdinalIgnoreCase))
{
if (TryGetArgs(args, out string arg0, out string arg1))
{
returnVal = IntrinsicFunctions.VersionGreaterThan(arg0, arg1);
return true;
}
}
else if (string.Equals(_methodMethodName, nameof(IntrinsicFunctions.VersionGreaterThanOrEquals), StringComparison.OrdinalIgnoreCase))
{
if (TryGetArgs(args, out string arg0, out string arg1))
{
returnVal = IntrinsicFunctions.VersionGreaterThanOrEquals(arg0, arg1);
return true;
}
}
else if (string.Equals(_methodMethodName, nameof(IntrinsicFunctions.VersionLessThan), StringComparison.OrdinalIgnoreCase))
{
if (TryGetArgs(args, out string arg0, out string arg1))
{
returnVal = IntrinsicFunctions.VersionLessThan(arg0, arg1);
return true;
}
}
else if (string.Equals(_methodMethodName, nameof(IntrinsicFunctions.VersionLessThanOrEquals), StringComparison.OrdinalIgnoreCase))
{
if (TryGetArgs(args, out string arg0, out string arg1))
{
returnVal = IntrinsicFunctions.VersionLessThanOrEquals(arg0, arg1);
return true;
}
}
}
else if (_receiverType == typeof(Path))
{
Expand Down

0 comments on commit a54c5be

Please sign in to comment.