Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jb@evain.net>2015-04-22 21:16:13 +0300
committerJb Evain <jb@evain.net>2015-04-22 21:16:13 +0300
commit468b2807bfaafc7267db1bb10c8379aa6a81249e (patch)
tree60d42620b12941c8c456fe1a9b3501d4ad13c6b6
parentb7b326bc04ea430728edc9668e6ae5e031fc8ac2 (diff)
Simplify return statements when possible
-rw-r--r--Mono.Cecil/GenericParameter.cs5
-rw-r--r--Mono.Cecil/MethodDefinition.cs5
-rw-r--r--Mono.Cecil/TypeDefinition.cs30
3 files changed, 8 insertions, 32 deletions
diff --git a/Mono.Cecil/GenericParameter.cs b/Mono.Cecil/GenericParameter.cs
index 637bf19..0f08593 100644
--- a/Mono.Cecil/GenericParameter.cs
+++ b/Mono.Cecil/GenericParameter.cs
@@ -67,10 +67,7 @@ namespace Mono.Cecil {
if (constraints != null)
return constraints.Count > 0;
- if (HasImage)
- return Module.Read (this, (generic_parameter, reader) => reader.HasGenericConstraints (generic_parameter));
-
- return false;
+ return HasImage && Module.Read (this, (generic_parameter, reader) => reader.HasGenericConstraints (generic_parameter));
}
}
diff --git a/Mono.Cecil/MethodDefinition.cs b/Mono.Cecil/MethodDefinition.cs
index 5ee3f79..fdaa0a9 100644
--- a/Mono.Cecil/MethodDefinition.cs
+++ b/Mono.Cecil/MethodDefinition.cs
@@ -190,10 +190,7 @@ namespace Mono.Cecil {
if (overrides != null)
return overrides.Count > 0;
- if (HasImage)
- return Module.Read (this, (method, reader) => reader.HasOverrides (method));
-
- return false;
+ return HasImage && Module.Read (this, (method, reader) => reader.HasOverrides (method));
}
}
diff --git a/Mono.Cecil/TypeDefinition.cs b/Mono.Cecil/TypeDefinition.cs
index 2e7ef25..e36e212 100644
--- a/Mono.Cecil/TypeDefinition.cs
+++ b/Mono.Cecil/TypeDefinition.cs
@@ -120,10 +120,7 @@ namespace Mono.Cecil {
if (interfaces != null)
return interfaces.Count > 0;
- if (HasImage)
- return Module.Read (this, (type, reader) => reader.HasInterfaces (type));
-
- return false;
+ return HasImage && Module.Read (this, (type, reader) => reader.HasInterfaces (type));
}
}
@@ -144,10 +141,7 @@ namespace Mono.Cecil {
if (nested_types != null)
return nested_types.Count > 0;
- if (HasImage)
- return Module.Read (this, (type, reader) => reader.HasNestedTypes (type));
-
- return false;
+ return HasImage && Module.Read (this, (type, reader) => reader.HasNestedTypes (type));
}
}
@@ -168,10 +162,7 @@ namespace Mono.Cecil {
if (methods != null)
return methods.Count > 0;
- if (HasImage)
- return methods_range.Length > 0;
-
- return false;
+ return HasImage && methods_range.Length > 0;
}
}
@@ -192,10 +183,7 @@ namespace Mono.Cecil {
if (fields != null)
return fields.Count > 0;
- if (HasImage)
- return fields_range.Length > 0;
-
- return false;
+ return HasImage && fields_range.Length > 0;
}
}
@@ -216,10 +204,7 @@ namespace Mono.Cecil {
if (events != null)
return events.Count > 0;
- if (HasImage)
- return Module.Read (this, (type, reader) => reader.HasEvents (type));
-
- return false;
+ return HasImage && Module.Read (this, (type, reader) => reader.HasEvents (type));
}
}
@@ -240,10 +225,7 @@ namespace Mono.Cecil {
if (properties != null)
return properties.Count > 0;
- if (HasImage)
- return Module.Read (this, (type, reader) => reader.HasProperties (type));
-
- return false;
+ return HasImage && Module.Read (this, (type, reader) => reader.HasProperties (type));
}
}