Skip to content

Commit 18f7a20

Browse files
committed
fix compilation
1 parent 4d37482 commit 18f7a20

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,21 +255,21 @@ bool ShouldIncludeRuntimeAsset(ITaskItem item)
255255
DependencyContext dependencyContext = builder.Build(UserRuntimeAssemblies);
256256

257257
var writer = new DependencyContextWriter();
258-
258+
259259
bool shouldWriteFile = true;
260-
260+
261261
// Generate new content
262262
using (var contentStream = new MemoryStream())
263263
{
264264
writer.Write(dependencyContext, contentStream);
265-
265+
266266
// If file exists, check if content is different using streaming hash comparison
267267
if (File.Exists(depsFilePath))
268268
{
269269
// Get hash length from a single instance to avoid unnecessary allocations
270-
using var hasher = new XxHash64();
270+
var hasher = new XxHash64();
271271
var hashLength = hasher.HashLengthInBytes;
272-
272+
273273
// Hash existing file content using streaming approach
274274
Span<byte> existingHashBuffer = stackalloc byte[hashLength];
275275
var existingHasher = new XxHash64();
@@ -285,7 +285,7 @@ bool ShouldIncludeRuntimeAsset(ITaskItem item)
285285
contentStream.Position = 0;
286286
newHasher.Append(contentStream);
287287
newHasher.GetCurrentHash(newHashBuffer);
288-
288+
289289
// If hashes are equal, content is the same - don't write
290290
if (existingHashBuffer.SequenceEqual(newHashBuffer))
291291
{

src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ private static void WriteToJsonFile(string fileName, object value)
393393
};
394394

395395
bool shouldWriteFile = true;
396-
396+
397397
// Generate new content
398398
using (var contentStream = new MemoryStream())
399399
{
@@ -404,14 +404,14 @@ private static void WriteToJsonFile(string fileName, object value)
404404
jsonWriter.Flush();
405405
streamWriter.Flush();
406406
}
407-
407+
408408
// If file exists, check if content is different using streaming hash comparison
409409
if (File.Exists(fileName))
410410
{
411411
// Get hash length from a single instance to avoid unnecessary allocations
412-
using var hasher = new XxHash64();
412+
var hasher = new XxHash64();
413413
var hashLength = hasher.HashLengthInBytes;
414-
414+
415415
// Hash existing file content using streaming approach
416416
Span<byte> existingHashBuffer = stackalloc byte[hashLength];
417417
var existingHasher = new XxHash64();
@@ -427,7 +427,7 @@ private static void WriteToJsonFile(string fileName, object value)
427427
contentStream.Position = 0;
428428
newHasher.Append(contentStream);
429429
newHasher.GetCurrentHash(newHashBuffer);
430-
430+
431431
// If hashes are equal, content is the same - don't write
432432
if (existingHashBuffer.SequenceEqual(newHashBuffer))
433433
{

0 commit comments

Comments
 (0)