Skip to content

Convert boolean expression to if statements to reduce async/await generation #123

@hazzik

Description

@hazzik
public bool AMethod() 
{
      return someSimpleCondition || AnotherMethod();
}

Now would be generated to:

public async Task<bool> AMethodAsync() 
{
      return someSimpleCondition || await AnotherMethodAsync();
}

Would be nice to generate following:

public Task<bool> AMethodAsync() 
{
      // wrapped in cancellation token & exception handling bolierplate code.
      if (someSimpleCondition)
           return Task.FromResult(true);
      return AnotherMethodAsync();
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions