Skip to content

Commit

Permalink
Address code review feedback
Browse files Browse the repository at this point in the history
Also bump up the NuGet package version
  • Loading branch information
karolz-ms committed Feb 24, 2023
1 parent 02e78a6 commit 2f6cd23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ElasticSearchOutput : IOutput

private enum FormatIndexType {QuarterOfYear, WeekOfMonth, WeekOfYearDoubleDigit, WeekOfYear}

private class FormatIndex: IComparable<FormatIndex>
private class FormatIndex: IComparable<FormatIndex>, IEquatable<FormatIndex>
{
public FormatIndex(int index, FormatIndexType formatIndexType)
{
Expand All @@ -54,6 +54,17 @@ public int CompareTo(FormatIndex other)
if (Index < other.Index) return 1;
return Index > other.Index? -1 : 0;
}

public override bool Equals(object obj)
{
FormatIndex other = obj as FormatIndex;
if (other is null) return false;
return Index == other.Index;
}

public bool Equals(FormatIndex other) => Index == other.Index;

public override int GetHashCode() => Index.GetHashCode();
}

private FormatIndex[] formatIndexes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Provides an output implementation that sends diagnostics data to Elasticsearch.</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<VersionPrefix>2.7.5</VersionPrefix>
<VersionPrefix>2.7.6</VersionPrefix>
<Authors>Microsoft</Authors>
<TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
<AssemblyName>Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch</AssemblyName>
Expand Down

0 comments on commit 2f6cd23

Please sign in to comment.