daily update on 20250214 by nitload youmu, building syntax analysor[D[D[D[D[D[C[C[C[C[C, tough!
This commit is contained in:
@@ -31,14 +31,15 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Collections
|
||||
{
|
||||
public partial class PartialDictionary<TKey, TValue> : IDictionary<TKey, TValue>
|
||||
{
|
||||
|
||||
private readonly Dictionary<TKey, TValue> _source;
|
||||
private readonly HashSet<TKey> _keys;
|
||||
private readonly PartialDictionaryValues _values;
|
||||
@@ -71,6 +72,23 @@ namespace StgSharp.Collections
|
||||
_values = new PartialDictionaryValues( this );
|
||||
}
|
||||
|
||||
public PartialDictionary(
|
||||
Dictionary<TKey, TValue> source,
|
||||
TKey[] index, IHashMultiplexer<TKey> multiplexer
|
||||
)
|
||||
{
|
||||
_source = source;
|
||||
_keys = new HashSet<TKey>(index);
|
||||
foreach (TKey item in _keys)
|
||||
{
|
||||
if (!_source.ContainsKey(item))
|
||||
{
|
||||
_source.Add(item, default!);
|
||||
}
|
||||
}
|
||||
_values = new PartialDictionaryValues(this);
|
||||
}
|
||||
|
||||
public TValue this[ TKey key ]
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user