diff options
author | Jb Evain <jb@evain.net> | 2015-04-22 21:16:13 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2015-04-22 21:16:13 +0300 |
commit | 468b2807bfaafc7267db1bb10c8379aa6a81249e (patch) | |
tree | 60d42620b12941c8c456fe1a9b3501d4ad13c6b6 | |
parent | b7b326bc04ea430728edc9668e6ae5e031fc8ac2 (diff) |
Simplify return statements when possible
-rw-r--r-- | Mono.Cecil/GenericParameter.cs | 5 | ||||
-rw-r--r-- | Mono.Cecil/MethodDefinition.cs | 5 | ||||
-rw-r--r-- | Mono.Cecil/TypeDefinition.cs | 30 |
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)); } } |