diff --git a/src/Tasks/AssemblyDependency/ReferenceTable.cs b/src/Tasks/AssemblyDependency/ReferenceTable.cs index 196a70b8747..3b214c55a9f 100644 --- a/src/Tasks/AssemblyDependency/ReferenceTable.cs +++ b/src/Tasks/AssemblyDependency/ReferenceTable.cs @@ -741,13 +741,8 @@ out string redistName /// private static void TryConvertToAssemblyName(string itemSpec, string fusionName, ref AssemblyNameExtension assemblyName) { - // FusionName is used if available. - string finalName = fusionName; - if (string.IsNullOrEmpty(finalName)) - { - // Otherwise, its itemSpec. - finalName = itemSpec; - } + // FusionName is used if available; otherwise use itemspec. + string finalName = string.IsNullOrEmpty(fusionName) ? itemSpec : fusionName; bool pathRooted = false; try diff --git a/src/Tasks/SystemState.cs b/src/Tasks/SystemState.cs index 2992e07bc73..2c11513b244 100644 --- a/src/Tasks/SystemState.cs +++ b/src/Tasks/SystemState.cs @@ -366,19 +366,14 @@ private FileState ComputeFileStateFromCachesAndDisk(string path) // If the process-wide cache contains an up-to-date FileState, always use it if (isProcessFileStateUpToDate) { - // If a FileState already exists in this instance cache due to deserialization, remove it; - // another instance has taken responsibility for serialization, and keeping this would - // result in multiple instances serializing the same data to disk - if (isCachedInInstance) + // For the next build, we may be using a different process. Update the file cache. + if (!isInstanceFileStateUpToDate) { - instanceLocalFileStateCache.Remove(path); + instanceLocalFileStateCache[path] = cachedProcessFileState; isDirty = true; } - return cachedProcessFileState; } - // If the process-wide FileState is missing or out-of-date, this instance owns serialization; - // sync the process-wide cache and signal other instances to avoid data duplication if (isInstanceFileStateUpToDate) { return s_processWideFileStateCache[path] = cachedInstanceFileState;