daily update on 20250214 by nitload youmu, building syntax analysor, tough!

This commit is contained in:
Nitload
2025-02-14 13:30:17 +08:00
parent c23b640cae
commit ccef0de6f6
68 changed files with 2594 additions and 913 deletions
@@ -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