Skip to content

Commit d4605ef

Browse files
committed
Override InitializationScript.GetHashCode
1 parent 3168750 commit d4605ef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dotnet/src/webdriver/InitializationScript.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ public override bool Equals(object obj)
5151
return obj is InitializationScript other && this.ScriptId == other.ScriptId && this.ScriptName == other.ScriptName && this.ScriptSource == other.ScriptSource;
5252
}
5353

54+
/// <summary>
55+
/// Serves as a hash function for a particular <see cref="InitializationScript"/>.
56+
/// </summary>
57+
/// <returns>A hash code for the current <see cref="InitializationScript"/>.</returns>
58+
public override int GetHashCode()
59+
{
60+
int result = this.ScriptId.GetHashCode();
61+
result = (31 * result) + this.ScriptName.GetHashCode();
62+
result = (31 * result) + this.ScriptSource.GetHashCode();
63+
return result;
64+
}
65+
5466
/// <summary>
5567
/// Returns a string that represents the current object.
5668
/// </summary>

0 commit comments

Comments
 (0)