Simplified if condition

This commit is contained in:
Ajay Bhargav Baaskaran 2017-03-23 19:04:24 -07:00
parent ae34e14358
commit 54831fed35
1 changed files with 4 additions and 10 deletions

View File

@ -62,17 +62,11 @@ namespace Microsoft.AspNetCore.Razor.Evolution.CodeGeneration
return; return;
} }
var imports = CodeDocument.GetImportSyntaxTrees(); if (SourceDocument.FileName != null &&
if (imports != null) !string.Equals(SourceDocument.FileName, node.Source.Value.FilePath, StringComparison.OrdinalIgnoreCase))
{ {
for (var i = 0; i < imports.Count; i++) // We don't want to generate line mappings for imports.
{ return;
if (string.Equals(imports[i].Source.FileName, node.Source.Value.FilePath, StringComparison.OrdinalIgnoreCase))
{
// We don't want to generate line mappings for imports.
return;
}
}
} }
var source = node.Source.Value; var source = node.Source.Value;