Skip to content

Commit bdc6a04

Browse files
committed
Refactor ParameterData constructor to use cache key only
Refactored the ParameterData class constructor to accept only a SymbolReflectionInfoCacheKey, extracting the parameter name and ParameterInfo from its ParameterDescriptor. Updated null checks and base constructor call accordingly.
1 parent 2a99e86 commit bdc6a04

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/BionicCode.Utilities.Reflection/ParameterData.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ internal sealed class ParameterData : SymbolInfoData
4444
private bool? _isIndexerPropertyGetterParameter;
4545
private bool? _isPropertySetterParameter;
4646

47-
internal ParameterData(ParameterInfo parameterInfo, SymbolReflectionInfoCacheKey symbolInfoDataCacheKey)
48-
: base(parameterInfo.Name, SymbolKind.Parameter, symbolInfoDataCacheKey)
47+
internal ParameterData(SymbolReflectionInfoCacheKey symbolInfoDataCacheKey)
48+
: base(symbolInfoDataCacheKey.ParameterDescriptor.ParameterName, SymbolKind.Parameter, symbolInfoDataCacheKey)
4949
{
50-
ArgumentNullException.ThrowIfNull(parameterInfo, nameof(parameterInfo));
50+
ArgumentNullExceptionAdvanced.ThrowIfDefault(symbolInfoDataCacheKey);
5151

52-
ParameterInfo = parameterInfo;
52+
ParameterInfo = symbolInfoDataCacheKey.ParameterDescriptor.ParameterInfo;
5353
}
5454

5555
internal ParameterInfo GetParameterInfo()

0 commit comments

Comments
 (0)