Browse Source

remove Activator.CreateInstance to get size

Bert Temme 2 years ago
parent
commit
187e405b37
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/SharpGLTF.Cesium/BinaryTable.cs

+ 1 - 1
src/SharpGLTF.Cesium/BinaryTable.cs

@@ -201,7 +201,7 @@ namespace SharpGLTF
             Guard.IsTrue(isValueType, nameof(T), "T must be a value type");
             Guard.IsTrue(isValueType, nameof(T), "T must be a value type");
 
 
             var type = typeof(T);
             var type = typeof(T);
-            int size = Marshal.SizeOf(Activator.CreateInstance(type));
+            var size = Marshal.SizeOf<T>();
             return size;
             return size;
         }
         }
     }
     }