[Modify] Polish it
This commit is contained in:
parent
b8c0741914
commit
08c29e7ee0
@ -486,18 +486,18 @@ namespace WebSocketSharp.Net
|
|||||||
/// <exception cref="ArgumentNullException">
|
/// <exception cref="ArgumentNullException">
|
||||||
/// <paramref name="cookie"/> is <see langword="null"/>.
|
/// <paramref name="cookie"/> is <see langword="null"/>.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public void Add (Cookie cookie)
|
public void Add (Cookie cookie)
|
||||||
{
|
{
|
||||||
if (cookie == null)
|
if (cookie == null)
|
||||||
throw new ArgumentNullException ("cookie");
|
throw new ArgumentNullException ("cookie");
|
||||||
|
|
||||||
var pos = searchCookie (cookie);
|
var idx = searchCookie (cookie);
|
||||||
if (pos == -1) {
|
if (idx == -1) {
|
||||||
_list.Add (cookie);
|
_list.Add (cookie);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_list[pos] = cookie;
|
_list[idx] = cookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user