Skip to content

Commit

Permalink
Revert "Fix dotnet#1715"
Browse files Browse the repository at this point in the history
This reverts commit 80f1e11.
  • Loading branch information
YegorStepanov committed Nov 1, 2022
1 parent 80f1e11 commit a15545b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/BenchmarkDotNet/Running/Descriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,22 @@ public Descriptor(
IterationCleanupMethod = iterationCleanupMethod;
OperationsPerInvoke = operationsPerInvoke;
AdditionalLogic = additionalLogic ?? string.Empty;
WorkloadMethodDisplayInfo = description ?? workloadMethod?.Name ?? "Untitled";
WorkloadMethodDisplayInfo = FormatDescription(description) ?? workloadMethod?.Name ?? "Untitled";
Baseline = baseline;
Categories = categories ?? Array.Empty<string>();
MethodIndex = methodIndex;
}

public override string ToString() => DisplayInfo;

private static string FormatDescription([CanBeNull] string description)
{
var specialSymbols = new[] { ' ', '\'', '[', ']' };
return description != null && specialSymbols.Any(description.Contains)
? "'" + description + "'"
: description;
}

public bool HasCategory(string category) => Categories.Any(c => c.EqualsWithIgnoreCase(category));

public string GetFilterName() => $"{Type.GetCorrectCSharpTypeName(includeGenericArgumentsNamespace: false)}.{WorkloadMethod.Name}";
Expand Down

0 comments on commit a15545b

Please sign in to comment.