Permalink
Browse files

Simplify ternary boolean expressions

  • Loading branch information...
1 parent 8b7bd21 commit 8b3e9bab4b7197c6020bd5a612f3db06d5e0acd3 @jbevain committed Jul 23, 2011
@@ -45,9 +45,7 @@ static partial class Mixin {
this ICustomAttributeProvider self,
ModuleDefinition module)
{
- return module.HasImage ()
- ? module.Read (self, (provider, reader) => reader.HasCustomAttributes (provider))
- : false;
+ return module.HasImage () && module.Read (self, (provider, reader) => reader.HasCustomAttributes (provider));
}
public static Collection<CustomAttribute> GetCustomAttributes (
@@ -58,9 +58,7 @@ static partial class Mixin {
this IGenericParameterProvider self,
ModuleDefinition module)
{
- return module.HasImage ()
- ? module.Read (self, (provider, reader) => reader.HasGenericParameters (provider))
- : false;
+ return module.HasImage () && module.Read (self, (provider, reader) => reader.HasGenericParameters (provider));
}
public static Collection<GenericParameter> GetGenericParameters (
@@ -40,9 +40,7 @@ static partial class Mixin {
this IMarshalInfoProvider self,
ModuleDefinition module)
{
- return module.HasImage ()
- ? module.Read (self, (provider, reader) => reader.HasMarshalInfo (provider))
- : false;
+ return module.HasImage () && module.Read (self, (provider, reader) => reader.HasMarshalInfo (provider));
}
public static MarshalInfo GetMarshalInfo (
@@ -176,9 +176,7 @@ static partial class Mixin {
this ISecurityDeclarationProvider self,
ModuleDefinition module)
{
- return module.HasImage ()
- ? module.Read (self, (provider, reader) => reader.HasSecurityDeclarations (provider))
- : false;
+ return module.HasImage () && module.Read (self, (provider, reader) => reader.HasSecurityDeclarations (provider));
}
public static Collection<SecurityDeclaration> GetSecurityDeclarations (

0 comments on commit 8b3e9ba

Please sign in to comment.