Skip to content

Commit 29ae16c

Browse files
author
Vincent Wilms
committed
Fix unnecessary allocations
1 parent 622e074 commit 29ae16c

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

src/PureHDF.SourceGenerator/PureHDF.SourceGenerator.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/PureHDF/VOL/Native/H5D/H5D_Chunk.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ private Memory<byte> ReadChunk(
238238
chunk = GC
239239
.AllocateUninitializedArray<byte>((int)ChunkByteSize);
240240

241-
chunk = new byte[(int)ChunkByteSize];
242-
243241
chunk.Span.Fill(Dataset.FillValue.Value);
244242
}
245243
}
@@ -260,8 +258,6 @@ private Memory<byte> ReadChunk(
260258
chunk = GC
261259
.AllocateUninitializedArray<byte>((int)ChunkByteSize);
262260

263-
chunk = new byte[(int)ChunkByteSize];
264-
265261
chunk.Span.Fill(Dataset.FillValue.Value);
266262
}
267263
}

tests/PureHDF.Tests/RoundTrip/DatasetTests@Opaque.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public void WriteAndReadOpaqueDataset()
1212
var expected = new byte[] { 0x01, 0x02, 0x13 };
1313

1414
h5FileWrite["test"] = new H5Dataset(
15-
data: expected,
16-
opaqueInfo: new H5OpaqueInfo((uint) expected.Length, "New")
15+
data: expected,
16+
opaqueInfo: new H5OpaqueInfo((uint)expected.Length, "New")
1717
);
1818

1919
var memoryStream = new MemoryStream();

0 commit comments

Comments
 (0)