Skip to content

Commit 63916a0

Browse files
committed
cleanup
1 parent 2a7700a commit 63916a0

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/NuGet.Core/NuGet.ProjectModel/CacheFileFormat.cs

+3-16
Original file line numberDiff line numberDiff line change
@@ -122,27 +122,14 @@ private static CacheFile ReadCacheFile(JsonElement cursor)
122122
private static object GetCacheFile(CacheFile cacheFile)
123123
{
124124
var json = new Dictionary<string, object>();
125-
126125
json[VersionProperty] = cacheFile.Version;
127-
128-
if (!string.IsNullOrEmpty(cacheFile.DgSpecHash))
129-
{
130-
json[DGSpecHashProperty] = cacheFile.DgSpecHash;
131-
}
132-
126+
json[DGSpecHashProperty] = cacheFile.DgSpecHash;
133127
json[SuccessProperty] = cacheFile.Success;
134128

135129
if (cacheFile.Version >= 2)
136130
{
137-
if (!string.IsNullOrEmpty(cacheFile.ProjectFilePath))
138-
{
139-
json[ProjectFilePathProperty] = cacheFile.ProjectFilePath;
140-
}
141-
142-
if (cacheFile.ExpectedPackageFilePaths != null && cacheFile.ExpectedPackageFilePaths.Count > 0)
143-
{
144-
json[ExpectedPackageFilesProperty] = cacheFile.ExpectedPackageFilePaths;
145-
}
131+
json[ProjectFilePathProperty] = cacheFile.ProjectFilePath;
132+
json[ExpectedPackageFilesProperty] = cacheFile.ExpectedPackageFilePaths;
146133

147134
if (cacheFile.LogMessages != null && cacheFile.LogMessages.Count > 0)
148135
{

0 commit comments

Comments
 (0)