我正在查看一些代码。 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