Skip to content

Commit 3168750

Browse files
committed
Remove implementation of IEquatable, override normal Equals
1 parent 43182ff commit 3168750

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dotnet/src/webdriver/InitializationScript.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
// under the License.
1818
// </copyright>
1919

20-
using System;
2120
using System.Globalization;
2221

2322
namespace OpenQA.Selenium
2423
{
2524
/// <summary>
2625
/// Represents a JavaScript script that is loaded and run on every document load.
2726
/// </summary>
28-
public class InitializationScript : IEquatable<InitializationScript>
27+
public class InitializationScript
2928
{
3029
/// <summary>
3130
/// Gets the internal ID of the initialization script.
@@ -47,9 +46,9 @@ public class InitializationScript : IEquatable<InitializationScript>
4746
/// </summary>
4847
/// <param name="other">An <see cref="InitializationScript"/> to compare with this <see cref="InitializationScript"/>.</param>
4948
/// <returns><see langword="true"/> if the current <see cref="InitializationScript"/> is equal to the other parameter; otherwise, <see langword="false"/>.</returns>
50-
public bool Equals(InitializationScript other)
49+
public override bool Equals(object obj)
5150
{
52-
return other is not null && this.ScriptId == other.ScriptId && this.ScriptName == other.ScriptName && this.ScriptSource == other.ScriptSource;
51+
return obj is InitializationScript other && this.ScriptId == other.ScriptId && this.ScriptName == other.ScriptName && this.ScriptSource == other.ScriptSource;
5352
}
5453

5554
/// <summary>

0 commit comments

Comments
 (0)