[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Collapse]Static Code Analysis
  [Collapse]Analyzers Library
    CRR0001 - Redundant sub-expressions in a binary operation
    CRR0002 - Suspect variable reference in a For-loop condition
    CRR0003 - Suspect variable reference in the For-loop iterator section
    CRR0004 - Ternary expression has identical branches
    CRR0005 - Expression value is always the same
    CRR0006 - Suspect variable reference in null-check following as-cast
    CRR0007 - String format item/argument mismatch
    CRR0008 - If-block matches else-block
    CRR0009 - Subsequent if-statements have identical conditions
    CRR0010 - Exception without throw
    CRR0011 - Next if-statement has an identical condition that will never be reached
    CRR0012 - Logical OR expression has opposite operands
    CRR0013 - The member always returns the same value
    CRR0014 - The variable is assigned twice in succession
    CRR0015 - Logical OR expression redundancy
    CRR0016 - Method call's return value is ignored
    CRR0017 - Null check follows usage
    CRR0018 - Suspect assignment reversal
    CRR0019 - Expression contains redundant subsets
    CRR0020 - Integral divide operation cast to float
    CRR0021 - Subsequent else-if conditions are identical
    CRR0022 - Unreachable conditional code block (a similar condition in the else branch)
    CRR0023 - Unnecessary conditional
    CRR0024 - Increase precision with a built-in constant or call
    CRR0025 - Unreachable conditional code block (the inversed condition is already satisfied)
    CRR0026 - Unused member
    CRR0027 - Possible System.NullReferenceException
    CRR0028 - Empty event handler
    CRR0029 - The ConfigureAwait(true) is called implicitly
    CRR0030 - Redundant 'await'
    CRR0031 - The returned Task is null
    CRR0033 - The void async method should be in a try/catch block
    CRR0034 - The async method should contain the
    CRR0035 - No CancellationToken parameter in the async method
    CRR0036 - The 'await Task.FromResult()' expression is redundant
    CRR0037 - Task.Wait is used in an async method
    CRR0038 - The CancellationToken parameter is never used
    CRR0039 - The 'await' expression without cancellation token
    CRR0041 - Use Task.Run instead of Task.Factory.StartNew
    CRR0042 - Unused parameter
    CRR0043 - Unused type
    CRR0044 - Unused local variable
    CRR0045 - Local variable can be replaced with discard
    CRR0046 - Redundant field initialization
    CRR0047 - The type can be moved to a separate file
    CRR0048 - The type name does not correspond to the file name
    CRR0049 - Environment.NewLine can be used
    CRR0050 - String.Compare can be used
    CRR0051 - String.IsNullOrEmpty can be used
    CRR0052 - String interpolation can be used
   Code Metrics
   Spell Checker
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
 [Expand]Extensibility
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

CRR0030 - Redundant 'await'

The Static Analysis tool detects whether async/await keywords are redundant.

You can omit async/await keywords if a method does not have the continuation code block. This allows you to avoid unnecessary delay in code execution. For example, you can return a Task from a method instead of the task's result if it is a Task type method.

Change the code above as follows to omit async/await:

If your async method contains the continuation code you cannot omit async/await keywords:

In the code above, when thread reaches await SomeAsyncMethod() this await makes the compiler to run operation on a new task and waits while this task is completed. Then, await causes thread to return and continue with execution. After the compiler finishes SomeAsyncMethod() it executes the DoSomething() method.

Is this topic helpful?​​​​​​​