From 3f1c87831802817f0cb3effacde954d3cbadfb6c Mon Sep 17 00:00:00 2001 From: Lyssa Date: Sun, 6 Apr 2025 19:35:08 +0400 Subject: remove unused CastToStruct function --- LibTSforge/Common.cs | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'LibTSforge') diff --git a/LibTSforge/Common.cs b/LibTSforge/Common.cs index a45870d..6b05bce 100644 --- a/LibTSforge/Common.cs +++ b/LibTSforge/Common.cs @@ -149,20 +149,6 @@ namespace LibTSforge } return result; } - - public static T CastToStruct(this byte[] data) where T : struct - { - GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); - try - { - IntPtr ptr = handle.AddrOfPinnedObject(); - return (T)Marshal.PtrToStructure(ptr, typeof(T)); - } - finally - { - handle.Free(); - } - } } public static class FileStreamExt -- cgit v1.2.3