Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static class FeedbackHub
/// </summary>
public static List<FeedbackResult>? GetFeedback(Runspace runspace, int millisecondsTimeout)
{
Requires.Condition(millisecondsTimeout > 0, nameof(millisecondsTimeout));
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(millisecondsTimeout);

var localRunspace = runspace as LocalRunspace;
if (localRunspace is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static class CommandPrediction
/// <returns>A list of <see cref="PredictionResult"/> objects.</returns>
public static async Task<List<PredictionResult>?> PredictInputAsync(PredictionClient client, Ast ast, Token[] astTokens, int millisecondsTimeout)
{
Requires.Condition(millisecondsTimeout > 0, nameof(millisecondsTimeout));
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(millisecondsTimeout);

var predictors = SubsystemManager.GetSubsystems<ICommandPredictor>();
if (predictors.Count == 0)
Expand Down
8 changes: 0 additions & 8 deletions src/System.Management.Automation/engine/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1748,13 +1748,5 @@ internal static void NotNullOrEmpty(ICollection value, string paramName)
throw new ArgumentNullException(paramName);
}
}

internal static void Condition([DoesNotReturnIf(false)] bool precondition, string paramName)
{
if (!precondition)
{
throw new ArgumentException(paramName);
}
}
}
}