C#: Fix type parameter names

This commit is contained in:
Tamas Vajk
2020-10-02 17:02:49 +02:00
parent 2e350caf9f
commit fbc128fcc7
9 changed files with 61 additions and 58 deletions

View File

@@ -7,11 +7,11 @@ namespace Semmle.Util
/// A dictionary which performs an action when items are added to the dictionary.
/// The order in which keys and actions are added does not matter.
/// </summary>
/// <typeparam name="Key"></typeparam>
/// <typeparam name="Value"></typeparam>
public class ActionMap<Key, Value> where Key : notnull
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
public class ActionMap<TKey, TValue> where TKey : notnull
{
public void Add(Key key, Value value)
public void Add(TKey key, TValue value)
{
if (actions.TryGetValue(key, out var a))
@@ -19,7 +19,7 @@ namespace Semmle.Util
values[key] = value;
}
public void OnAdd(Key key, Action<Value> action)
public void OnAdd(TKey key, Action<TValue> action)
{
if (actions.TryGetValue(key, out var a))
{
@@ -37,9 +37,9 @@ namespace Semmle.Util
}
// Action associated with each key.
private readonly Dictionary<Key, Action<Value>> actions = new Dictionary<Key, Action<Value>>();
private readonly Dictionary<TKey, Action<TValue>> actions = new Dictionary<TKey, Action<TValue>>();
// Values associated with each key.
private readonly Dictionary<Key, Value> values = new Dictionary<Key, Value>();
private readonly Dictionary<TKey, TValue> values = new Dictionary<TKey, TValue>();
}
}