From b9831cc33ebba9d195a9082eaacf5190da3b1dab Mon Sep 17 00:00:00 2001 From: John Luke Date: Tue, 15 Mar 2005 16:40:24 +0000 Subject: [PATCH] 2005-03-15 John Luke * glib/Object.cs: use IsDefined to check for ClassInitializer attribute, fixes a warning and is supposedly better for performance svn path=/trunk/gtk-sharp/; revision=41839 --- ChangeLog | 5 +++++ glib/Object.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d2443769b..e464a87fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-15 John Luke + + * glib/Object.cs: use IsDefined to check for ClassInitializer + attribute, fixes a warning and is supposedly better for performance + 2005-03-15 Dan Winship Re-fix for yesterday's fix that didn't actually work. diff --git a/glib/Object.cs b/glib/Object.cs index 725f836ef..5a436a599 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -142,7 +142,7 @@ namespace GLib { object[] parms = {gtype, t}; BindingFlags flags = BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy; foreach (MethodInfo minfo in t.GetMethods(flags)) - foreach (object attr in minfo.GetCustomAttributes (typeof (ClassInitializerAttribute), true)) + if (minfo.IsDefined (typeof (ClassInitializerAttribute), true)) minfo.Invoke (null, parms); }