diff --git a/src/MyCSharp.HttpUserAgentParser.MemoryCache/HttpUserAgentParserMemoryCachedProvider.cs b/src/MyCSharp.HttpUserAgentParser.MemoryCache/HttpUserAgentParserMemoryCachedProvider.cs index f618c5f..7ebf9d8 100644 --- a/src/MyCSharp.HttpUserAgentParser.MemoryCache/HttpUserAgentParserMemoryCachedProvider.cs +++ b/src/MyCSharp.HttpUserAgentParser.MemoryCache/HttpUserAgentParserMemoryCachedProvider.cs @@ -50,20 +50,10 @@ private CacheKey GetKey(string userAgent) public HttpUserAgentParserMemoryCachedProviderOptions Options { get; set; } = null!; - public bool Equals(CacheKey? other) - { - if (ReferenceEquals(this, other)) return true; - if (other is null) return false; - - return this.UserAgent == other.UserAgent && this.Options == other.Options; - } - - public override bool Equals(object? obj) - { - return this.Equals(obj as CacheKey); - } + public bool Equals(CacheKey? other) => this.UserAgent == other?.UserAgent; + public override bool Equals(object? obj) => this.Equals(obj as CacheKey); - public override int GetHashCode() => HashCode.Combine(this.UserAgent, this.Options); + public override int GetHashCode() => this.UserAgent.GetHashCode(); } } }