Skip to content

Commit

Permalink
update to span
Browse files Browse the repository at this point in the history
  • Loading branch information
AnakinRaW committed Jun 9, 2024
1 parent b89074f commit 46259a5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.6.133</Version>
<Version>3.6.139</Version>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion PetroglyphTools
Submodule PetroglyphTools updated 58 files
+1 −1 Directory.Build.props
+62 −0 PG.Benchmarks/EmpireAtWarValidatorBenchmark.cs
+1 −1 PG.Benchmarks/GetStringFromBinary.cs
+1 −0 PG.Benchmarks/PG.Benchmarks.csproj
+2 −1 PG.Benchmarks/Program.cs
+4 −3 PG.Commons/PG.Commons.Test/Utilities/FileNameUtilitiesTest.cs
+0 −50 PG.Commons/PG.Commons.Test/Utilities/Validation/NullableAbstractValidatorTest.cs
+4 −21 PG.Commons/PG.Commons/Hashing/Crc32HashingService.cs
+2 −3 PG.Commons/PG.Commons/PG.Commons.csproj
+1 −2 PG.Commons/PG.Commons/Services/Builder/Normalization/BuilderEntryNormalizerBase.cs
+35 −1 PG.Commons/PG.Commons/Utilities/EncodingExtensions.cs
+4 −7 PG.Commons/PG.Commons/Utilities/FileNameUtilities.cs
+0 −29 PG.Commons/PG.Commons/Utilities/Validation/NullableAbstractValidator.cs
+13 −14 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT.Test/Services/Builder/DatBuilderBaseTest.cs
+1 −2 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT.Test/Services/Builder/SortedDatBuilderBaseTest.cs
+2 −3 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT.Test/Services/Builder/UnsortedDatBuilderBaseTest.cs
+2 −2 ...arsGame.Files.DAT/PG.StarWarsGame.Files.DAT.Test/Services/Builder/Validation/EmpireAtWarKeyValidatorTest.cs
+3 −3 ...tarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT.Test/Services/Builder/Validation/NotNullKeyValidatorTest.cs
+10 −10 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT/Services/Builder/DatBuilderBase.cs
+23 −22 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT/Services/Builder/Validation/EmpireAtWarKeyValidator.cs
+17 −2 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT/Services/Builder/Validation/IDatKeyValidator.cs
+16 −3 PG.StarWarsGame.Files.DAT/PG.StarWarsGame.Files.DAT/Services/Builder/Validation/NotNullKeyValidator.cs
+16 −18 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Binary/Validation/MegBinaryValidatorTest.cs
+4 −5 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Binary/Validation/MegFileSizeValidatorTest.cs
+5 −5 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Binary/Validation/MegFileTableValidatorTest.cs
+6 −8 ...Game.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Binary/Validation/V1/MegFileSizeValidatorV1IntegrationTest.cs
+7 −9 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Binary/Validation/V1/MegFileSizeValidatorV1Test.cs
+6 −9 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Services/Builder/MegBuilderBaseTest.cs
+21 −14 ...iles.MEG/PG.StarWarsGame.Files.MEG.Test/Services/Builder/Validation/EmpireAtWarMegDataEntryValidatorTest.cs
+3 −3 ...sGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Services/Builder/Validation/NotNullDataEntryValidatorTest.cs
+9 −2 ...Files.MEG/PG.StarWarsGame.Files.MEG.Test/Services/Builder/Validation/PetroglyphMegDataEntryValidatorTest.cs
+0 −14 ...MEG/PG.StarWarsGame.Files.MEG.Test/Services/Builder/Validation/PetroglyphMegFileInformationValidatorTest.cs
+4 −7 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG.Test/Services/MegFileService/MegFileServiceTest_Load.cs
+4 −2 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/IFileTableValidator.cs
+4 −3 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/IMegBinaryValidator.cs
+4 −3 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/IMegFileSizeValidator.cs
+10 −9 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/MegBinaryValidator.cs
+13 −13 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/MegFileSizeValidator.cs
+12 −16 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/MegFileTableValidator.cs
+11 −12 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Binary/Validation/V1/V1SizeValidator.cs
+3 −3 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/MegServiceContribution.cs
+5 −4 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/MegBuilderBase.cs
+7 −3 ...rsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Normalization/DefaultDataEntryPathNormalizer.cs
+19 −1 ...rWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Normalization/IMegDataEntryPathNormalizer.cs
+42 −0 ...rsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Normalization/MegDataEntryPathNormalizerBase.cs
+9 −7 ...ame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Normalization/PetroglyphDataEntryPathNormalizer.cs
+10 −14 ...tarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/PetroglyphRelativeDataEntryPathResolver.cs
+26 −18 ...sGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/DefaultMegFileInformationValidator.cs
+32 −22 ...arsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/EmpireAtWarMegDataEntryValidator.cs
+28 −21 ...e.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/EmpireAtWarMegFileInformationValidator.cs
+9 −2 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/IBuilderInfoValidator.cs
+47 −2 ...tarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/IMegFileInformationValidator.cs
+18 −4 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/NotNullDataEntryValidator.cs
+41 −41 ...WarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/PetroglyphMegDataEntryValidator.cs
+15 −21 ...me.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Builder/Validation/PetroglyphMegFileInformationValidator.cs
+2 −3 PG.StarWarsGame.Files.MEG/PG.StarWarsGame.Files.MEG/Services/Internal/MegFileService.cs
+10 −0 PG.Testing/Hashing/HashCodeCrc32HashingService.cs
+10 −0 PG.Testing/Hashing/ParseIntCrc32HashingService.cs
2 changes: 1 addition & 1 deletion src/ModVerify/ModVerify.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AnakinRaW.CommonUtilities.SimplePipeline" Version="12.0.3-beta" />
<PackageReference Include="AnakinRaW.CommonUtilities.SimplePipeline" Version="12.0.15-beta" />
<PackageReference Include="IsExternalInit" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AnakinRaW.CommonUtilities.SimplePipeline" Version="12.0.3-beta" />
<PackageReference Include="AnakinRaW.CommonUtilities.SimplePipeline" Version="12.0.15-beta" />
<PackageReference Include="IsExternalInit" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,10 @@ internal void Seal()

protected MegDataEntryReference? FindFileInMasterMeg(string filePath)
{
// TODO To Span, as we don't use the name elsewhere
var normalizedPath = _megPathNormalizer.Normalize(filePath);
var crc = _crc32HashingService.GetCrc32(normalizedPath, PGConstants.PGCrc32Encoding);
Span<char> fileNameBuffer = stackalloc char[260];
var length = _megPathNormalizer.Normalize(filePath.AsSpan(), fileNameBuffer);
var fileName = fileNameBuffer.Slice(0, length);
var crc = _crc32HashingService.GetCrc32(fileName, PGConstants.PGCrc32Encoding);

return MasterMegArchive?.FirstEntryWithCrc(crc);
}
Expand Down

0 comments on commit 46259a5

Please sign in to comment.