Removing declaration expressions
This commit is contained in:
parent
d8995a7767
commit
a4fff7a2e0
|
|
@ -85,12 +85,13 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives
|
||||||
public void MergeInheritedChunks(List<Chunk> inherited)
|
public void MergeInheritedChunks(List<Chunk> inherited)
|
||||||
{
|
{
|
||||||
var current = CodeTree.Chunks;
|
var current = CodeTree.Chunks;
|
||||||
|
IChunkMerger merger;
|
||||||
|
|
||||||
// We merge chunks into the codeTree in two passes. In the first pass, we traverse the CodeTree visiting
|
// We merge chunks into the codeTree in two passes. In the first pass, we traverse the CodeTree visiting
|
||||||
// a mapped IChunkMerger for types that are registered.
|
// a mapped IChunkMerger for types that are registered.
|
||||||
foreach (var chunk in current)
|
foreach (var chunk in current)
|
||||||
{
|
{
|
||||||
if (ChunkMergers.TryGetValue(chunk.GetType(), out var merger))
|
if (ChunkMergers.TryGetValue(chunk.GetType(), out merger))
|
||||||
{
|
{
|
||||||
merger.VisitChunk(chunk);
|
merger.VisitChunk(chunk);
|
||||||
}
|
}
|
||||||
|
|
@ -101,7 +102,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives
|
||||||
// rules.
|
// rules.
|
||||||
foreach (var chunk in inherited)
|
foreach (var chunk in inherited)
|
||||||
{
|
{
|
||||||
if (ChunkMergers.TryGetValue(chunk.GetType(), out var merger))
|
if (ChunkMergers.TryGetValue(chunk.GetType(), out merger))
|
||||||
{
|
{
|
||||||
// TODO: When mapping chunks, we should remove mapping information since it would be incorrect
|
// TODO: When mapping chunks, we should remove mapping information since it would be incorrect
|
||||||
// to generate it in the page that inherits it. Tracked by #945
|
// to generate it in the page that inherits it. Tracked by #945
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
|
|
||||||
public CompilationResult GetOrAdd(RelativeFileInfo fileInfo, Func<CompilationResult> compile)
|
public CompilationResult GetOrAdd(RelativeFileInfo fileInfo, Func<CompilationResult> compile)
|
||||||
{
|
{
|
||||||
if (!_cache.TryGetValue(fileInfo.RelativePath, out var cacheEntry))
|
CompilerCacheEntry cacheEntry;
|
||||||
|
if (!_cache.TryGetValue(fileInfo.RelativePath, out cacheEntry))
|
||||||
{
|
{
|
||||||
return OnCacheMiss(fileInfo, compile);
|
return OnCacheMiss(fileInfo, compile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue