Clean up logic of object interpretation in PDT interpreter.

This commit is contained in:
2023-04-07 12:21:20 +08:00
parent 1fc5ea8ac6
commit 6cb36a7064
3 changed files with 40 additions and 54 deletions

View File

@@ -28,6 +28,10 @@ namespace Cryville.Common.Collections.Generic {
if (_pairList != null) _pairList.CopyTo(array, index);
else _dictionary.CopyTo(array, index);
}
public static bool IsPairCollection(Type type) {
return typeof(IPairList<TKey, TValue>).IsAssignableFrom(type) || typeof(IDictionary<TKey, TValue>).IsAssignableFrom(type);
}
}
internal class PairCollectionDebugView<TKey, TValue> {
readonly PairCollection<TKey, TValue> _self;