Skip to content

Commit 66ddf97

Browse files
committed
removed unnecessary dictionary initialization in CLRObject
1 parent 4afa4bd commit 66ddf97

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/runtime/clrobject.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ internal CLRObject(object ob, IntPtr tp)
1414
System.Diagnostics.Debug.Assert(tp != IntPtr.Zero);
1515
IntPtr py = Runtime.PyType_GenericAlloc(tp, 0);
1616

17-
long flags = Util.ReadCLong(tp, TypeOffset.tp_flags);
18-
if ((flags & TypeFlags.Subclass) != 0)
19-
{
20-
IntPtr dict = Marshal.ReadIntPtr(py, ObjectOffset.TypeDictOffset(tp));
21-
if (dict == IntPtr.Zero)
22-
{
23-
dict = Runtime.PyDict_New();
24-
Marshal.WriteIntPtr(py, ObjectOffset.TypeDictOffset(tp), dict);
25-
}
26-
}
27-
2817
GCHandle gc = AllocGCHandle(TrackTypes.Wrapper);
2918
Marshal.WriteIntPtr(py, ObjectOffset.magic(tp), (IntPtr)gc);
3019
tpHandle = tp;

0 commit comments

Comments
 (0)