Not very important code optimization (#1030)

Code optimization
This commit is contained in:
Gurgen Hakobyan 2017-10-18 20:23:33 +04:00 committed by Pawel Kadluczka
parent 0e70c7950b
commit b3ac9f4bf8
1 changed files with 3 additions and 10 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
@ -16,11 +15,8 @@ namespace Microsoft.AspNetCore.SignalR
{
get
{
if (_connections.TryGetValue(connectionId, out var connection))
{
return connection;
}
return null;
_connections.TryGetValue(connectionId, out var connection);
return connection;
}
}
@ -38,10 +34,7 @@ namespace Microsoft.AspNetCore.SignalR
public IEnumerator<HubConnectionContext> GetEnumerator()
{
foreach (var item in _connections)
{
yield return item.Value;
}
return _connections.Values.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()