remove code duplication
authorJb Evain <jbevain@gmail.com>
Thu, 2 Aug 2007 16:04:30 +0000 (16:04 -0000)
committerJb Evain <jbevain@gmail.com>
Thu, 2 Aug 2007 16:04:30 +0000 (16:04 -0000)
svn path=/trunk/mcs/; revision=83297

mcs/tools/linker/Mono.Linker.Steps/AdjustVisibilityStep.cs

index 52b07f1a2aa6cd14519a579c99506e08e992d07b..ea8d479f5293fc874fc571af827e203bd9865885 100644 (file)
@@ -41,7 +41,7 @@ namespace Mono.Linker.Steps {
 
                static void ProcessType (TypeDefinition type)
                {
-                       if (!IsPublic (type))
+                       if (!type.IsPublic)
                                return;
 
                        if (!IsMarkedAsPublic (type)) {
@@ -71,7 +71,7 @@ namespace Mono.Linker.Steps {
 
                static void ProcessMethod (MethodDefinition method)
                {
-                       if (!IsPublic (method))
+                       if (!method.IsPublic)
                                return;
 
                        if (IsMarkedAsPublic (method))
@@ -91,21 +91,6 @@ namespace Mono.Linker.Steps {
                        return Annotations.IsPublic (provider);
                }
 
-               static bool IsPublic (MethodDefinition method)
-               {
-                       return (method.Attributes & MethodAttributes.Public) != 0;
-               }
-
-               static bool IsPublic (FieldDefinition field)
-               {
-                       return (field.Attributes & FieldAttributes.Public) != 0;
-               }
-
-               static bool IsPublic (TypeDefinition type)
-               {
-                       return (type.Attributes & TypeAttributes.Public) != 0;
-               }
-
                static void ProcessFields (FieldDefinitionCollection fields)
                {
                        foreach (FieldDefinition field in fields)
@@ -114,7 +99,7 @@ namespace Mono.Linker.Steps {
 
                static void ProcessField (FieldDefinition field)
                {
-                       if (!IsPublic (field))
+                       if (!field.IsPublic)
                                return;
 
                        if (IsMarkedAsPublic (field))