Skip to content

Commit

Permalink
Merge pull request #55 from martindevans/removed_dictionary_extensions
Browse files Browse the repository at this point in the history
Cleaned up unnecessary extension methods
  • Loading branch information
AsakusaRinne authored Jul 24, 2023
2 parents d17fa99 + 18462be commit dee9afc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
30 changes: 0 additions & 30 deletions LLama/Extensions/DictionaryExtensions.cs

This file was deleted.

24 changes: 24 additions & 0 deletions LLama/Extensions/KeyValuePairExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;

namespace LLama.Extensions
{
/// <summary>
/// Extensions to the KeyValuePair struct
/// </summary>
public static class KeyValuePairExtensions
{
/// <summary>
/// Deconstruct a KeyValuePair into it's constituent parts.
/// </summary>
/// <param name="pair">The KeyValuePair to deconstruct</param>
/// <param name="first">First element, the Key</param>
/// <param name="second">Second element, the Value</param>
/// <typeparam name="TKey">Type of the Key</typeparam>
/// <typeparam name="TValue">Type of the Value</typeparam>
public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> pair, out TKey first, out TValue second)
{
first = pair.Key;
second = pair.Value;
}
}
}

0 comments on commit dee9afc

Please sign in to comment.