Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
yaakov-h committed May 5, 2019
1 parent b339055 commit 2b209cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 1 addition & 3 deletions SteamKit2/SteamKit2/Steam/WebAPI/WebAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,8 @@ public override bool TryInvokeMember( InvokeMemberBinder binder, object[] args,
var apiArgs = new Dictionary<string, object>();
var requestMethod = HttpMethod.Get;

foreach ( var kvp in methodArgs )
foreach ( var ( argName, argValue ) in methodArgs )
{
var ( argName, argValue) = ( kvp.Key, kvp.Value );

// method is a reserved param for selecting the http request method
if ( argName.Equals( "method", StringComparison.OrdinalIgnoreCase ) )
{
Expand Down
13 changes: 13 additions & 0 deletions SteamKit2/SteamKit2/Util/KeyValuePairExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace SteamKit2
{
static class KeyValuePairExtensions
{
public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> kvp, out TKey key, out TValue value)
{
key = kvp.Key;
value = kvp.Value;
}
}
}

0 comments on commit 2b209cb

Please sign in to comment.