@@ -603,7 +603,7 @@ private object GetPayloadValueAt(ref PayloadFetch payloadFetch, int offset, int
603
603
PayloadFetchClassInfo classInfo = payloadFetch . Class ;
604
604
if ( classInfo != null )
605
605
{
606
- var ret = new StructValue ( ) ;
606
+ var ret = new StructValue ( classInfo . FieldFetches . Length ) ;
607
607
608
608
for ( int i = 0 ; i < classInfo . FieldFetches . Length ; i ++ )
609
609
{
@@ -797,6 +797,10 @@ private object GetPayloadValueAt(ref PayloadFetch payloadFetch, int offset, int
797
797
/// </summary>
798
798
internal class StructValue : IDictionary < string , object >
799
799
{
800
+ internal StructValue ( int capacity = 0 )
801
+ {
802
+ m_values = new List < KeyValuePair < string , object > > ( capacity ) ;
803
+ }
800
804
public IEnumerator < KeyValuePair < string , object > > GetEnumerator ( ) { return m_values . GetEnumerator ( ) ; }
801
805
System . Collections . IEnumerator System . Collections . IEnumerable . GetEnumerator ( ) { return m_values . GetEnumerator ( ) ; }
802
806
public bool IsReadOnly { get { return true ; } }
@@ -937,7 +941,7 @@ public bool ContainsKey(string key)
937
941
public void CopyTo ( KeyValuePair < string , object > [ ] array , int arrayIndex ) { throw new NotImplementedException ( ) ; }
938
942
public bool Remove ( KeyValuePair < string , object > item ) { throw new NotImplementedException ( ) ; }
939
943
940
- private List < KeyValuePair < string , object > > m_values = new List < KeyValuePair < string , object > > ( ) ;
944
+ private List < KeyValuePair < string , object > > m_values ;
941
945
#endregion
942
946
}
943
947
0 commit comments