我正在查看一些代碼。 VS將返回語句標記爲冗餘控制流跳轉語句,並建議將其刪除。什麼是正確的語法?冗餘控制流跳轉語句
private async void TokenButton_Click(object sender, RoutedEventArgs e)
{
try
{
var accountType = _settings["account_type"];
if (accountType.Equals(AccountTypeMicrosoft))
{
this.Status.Text += "The original token is good for Live. No new token is needed.\n";
}
else
{
// Get access token for the target service
if (!await GetAccessTokenForServiceAsync().ConfigureAwait(true))
{
return;
}
}
}
catch (Exception ex)
{
this.Status.Text += "Exception caught: '" + ex.Message + "'.";
this.Status.Foreground = _errorBrush;
}
}
的同時刪除了整個事情,如果它是一個純函數調用 – 2014-11-03 05:41:10