Skip to content

Commit

Permalink
Merge pull request #788 from Nexus-Mods/dependabot/nuget/nexusmods-be…
Browse files Browse the repository at this point in the history
…13d7ba64

Bump the nexusmods group with 2 updates
  • Loading branch information
Sewer56 authored Nov 27, 2023
2 parents 347491a + dc63e98 commit 0af4b76
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 261 deletions.
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<ItemGroup>
<!-- Custom Packages -->
<PackageVersion Include="NexusMods.Hashing.xxHash64" Version="1.0.1" />
<PackageVersion Include="NexusMods.Paths" Version="0.1.8" />
<PackageVersion Include="NexusMods.Paths" Version="0.2.0" />
<PackageVersion Include="NexusMods.Archives.Nx" Version="0.3.7" />
<PackageVersion Include="NexusMods.Paths.TestingHelpers" Version="0.1.8" />
<PackageVersion Include="NexusMods.Paths.TestingHelpers" Version="0.2.0" />
<PackageVersion Include="NexusMods.ProxyConsole.Abstractions" Version="0.6.0" />
<PackageVersion Include="NexusMods.SingleProcess" Version="0.6.0" />
<PackageVersion Include="NexusMods.Telemetry.OpenTelemetry" Version="1.0.0" />
Expand Down
65 changes: 0 additions & 65 deletions benchmarks/NexusMods.Benchmarks/Benchmarks/ChangeCase.cs

This file was deleted.

This file was deleted.

122 changes: 0 additions & 122 deletions benchmarks/NexusMods.Benchmarks/Benchmarks/VectorisedStringHash.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text.Json.Serialization;
using JetBrains.Annotations;
using NexusMods.Paths.Extensions;
using Reloaded.Memory.Extensions;

namespace NexusMods.Games.StardewValley.Models;

Expand Down
13 changes: 8 additions & 5 deletions src/NexusMods.DataModel/ChunkedStreams/ChunkedStream.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Buffers;
using NexusMods.Paths.Extensions;
using Reloaded.Memory.Extensions;

namespace NexusMods.DataModel.ChunkedStreams;

Expand Down Expand Up @@ -28,9 +29,7 @@ public ChunkedStream(T source, int capacity = 16)
}

/// <inheritdoc />
public override void Flush()
{
}
public override void Flush() { }


/// <inheritdoc />
Expand All @@ -55,6 +54,7 @@ public override int Read(byte[] buffer, int offset, int count)
toRead = Math.Min(toRead, (int)lastChunkExtraSize);
}
}

chunk.Slice((int)chunkOffset, toRead)
.Span
.CopyTo(buffer.AsSpan(offset, toRead));
Expand All @@ -64,7 +64,8 @@ public override int Read(byte[] buffer, int offset, int count)


/// <inheritdoc />
public override async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = new CancellationToken())
public override async ValueTask<int> ReadAsync(Memory<byte> buffer,
CancellationToken cancellationToken = new CancellationToken())
{
if (_position >= _source.Size.Value)
{
Expand All @@ -87,12 +88,12 @@ public override int Read(byte[] buffer, int offset, int count)
toRead = Math.Min(toRead, (int)lastChunkExtraSize);
}
}

chunk.Slice((int)chunkOffset, toRead)
.Span
.CopyTo(buffer.Span.SliceFast(0, toRead));
_position += (ulong)toRead;
return toRead;

}

private async ValueTask<Memory<byte>> GetChunkAsync(ulong index, CancellationToken token)
Expand All @@ -101,6 +102,7 @@ private async ValueTask<Memory<byte>> GetChunkAsync(ulong index, CancellationTok
{
return memory!.Memory;
}

var memoryOwner = _pool.Rent((int)_source.ChunkSize.Value);
await _source.ReadChunkAsync(memoryOwner.Memory, index, token);
_cache.Add(index, memoryOwner);
Expand All @@ -113,6 +115,7 @@ private Memory<byte> GetChunk(ulong index)
{
return memory!.Memory;
}

var memoryOwner = _pool.Rent((int)_source.ChunkSize.Value);
_source.ReadChunk(memoryOwner.Memory.Span, index);
_cache.Add(index, memoryOwner);
Expand Down
3 changes: 3 additions & 0 deletions src/NexusMods.DataModel/ChunkedStreams/LightweightLRUCache.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NexusMods.Paths.Extensions;
using Reloaded.Memory.Extensions;

namespace NexusMods.DataModel.ChunkedStreams;

Expand Down Expand Up @@ -45,6 +46,7 @@ public bool TryGet(TK key, out TV? value)
Touch(index);
return true;
}

value = default;
return false;
}
Expand Down Expand Up @@ -78,6 +80,7 @@ private readonly int Find(TK key)
{
if (_keys[i].Equals(key)) return i;
}

return -1;
}

Expand Down
1 change: 1 addition & 0 deletions src/NexusMods.DataModel/Loadouts/Cursors/ModCursor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NexusMods.DataModel.Interprocess;
using NexusMods.Paths.Extensions;
using Reloaded.Memory.Extensions;

namespace NexusMods.DataModel.Loadouts.Cursors;

Expand Down
1 change: 1 addition & 0 deletions src/NexusMods.DataModel/Loadouts/DiskStateRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NexusMods.DataModel.Abstractions;
using NexusMods.DataModel.LoadoutSynchronizer;
using NexusMods.Paths.Extensions;
using Reloaded.Memory.Extensions;

namespace NexusMods.DataModel.Loadouts;

Expand Down
Loading

0 comments on commit 0af4b76

Please sign in to comment.