From 7426ac9ebdcd529ce029b499ad583d8ea2cd28a2 Mon Sep 17 00:00:00 2001 From: badcel <1218031+badcel@users.noreply.github.com> Date: Tue, 3 Sep 2024 20:44:36 +0200 Subject: [PATCH] GObject.Type: Mark struct as readonly and make it a record This improves performance as a generated equality function is used instead of a runtime check and allows for further compiler optimizations. --- src/Libs/GLib-2.0/GObject/Public/Type.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libs/GLib-2.0/GObject/Public/Type.cs b/src/Libs/GLib-2.0/GObject/Public/Type.cs index 3ff15da8a..1235391c5 100644 --- a/src/Libs/GLib-2.0/GObject/Public/Type.cs +++ b/src/Libs/GLib-2.0/GObject/Public/Type.cs @@ -3,7 +3,7 @@ namespace GObject; [StructLayout(LayoutKind.Explicit)] -public struct Type +public readonly record struct Type { //This is a manual implementation of GObject.Type inside GLib project inside the GObject namespace.