Compare commits

...

5 Commits
1.8.5 ... 1.8.6

Author SHA1 Message Date
Matt Nadareski
f0f997fadd Bump version 2024-12-30 22:51:13 -05:00
Matt Nadareski
0ce3c9892d Remove attempt at caching version info strings 2024-12-30 22:40:52 -05:00
Matt Nadareski
9743565285 Update copyright 2024-12-30 21:39:36 -05:00
Matt Nadareski
fcfe9e4790 Remove unnecessary action step 2024-12-30 21:39:30 -05:00
Matt Nadareski
be36432296 Update packages 2024-12-30 21:28:13 -05:00
5 changed files with 31 additions and 54 deletions

View File

@@ -27,12 +27,6 @@ jobs:
- name: Run publish script
run: ./publish-nix.sh -d
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: "*.nupkg,*.snupkg"
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:

View File

@@ -9,7 +9,7 @@
<Nullable>enable</Nullable>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.8.4</Version>
<Version>1.8.6</Version>
</PropertyGroup>
<!-- Support All Frameworks -->

View File

@@ -22,7 +22,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View File

@@ -12,12 +12,12 @@
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.8.5</Version>
<Version>1.8.6</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
<Description>Serialization and deserialization helpers for various types</Description>
<Copyright>Copyright (c) Matt Nadareski 2019-2024</Copyright>
<Copyright>Copyright (c) Matt Nadareski 2019-2025</Copyright>
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Serialization</RepositoryUrl>

View File

@@ -749,11 +749,6 @@ namespace SabreTools.Serialization.Wrappers
/// </summary>
private Models.PortableExecutable.VersionInfo? _versionInfo = null;
/// <summary>
/// Cached version info strings data
/// </summary>
private readonly Dictionary<string, string?> _versionInfoStrings = [];
/// <summary>
/// Cached assembly manifest data
/// </summary>
@@ -850,50 +845,38 @@ namespace SabreTools.Serialization.Wrappers
if (string.IsNullOrEmpty(key))
return null;
lock (_sourceDataLock)
{
// If we have the value cached
if (_versionInfoStrings.ContainsKey(key))
return _versionInfoStrings[key];
// Ensure that we have the resource data cached
if (ResourceData == null)
return null;
// Ensure that we have the resource data cached
if (ResourceData == null)
return null;
// If we don't have string version info in this executable
var stringTable = _versionInfo?.StringFileInfo?.Children;
if (stringTable == null || stringTable.Length == 0)
return null;
// If we don't have string version info in this executable
var stringTable = _versionInfo?.StringFileInfo?.Children;
if (stringTable == null || stringTable.Length == 0)
return null;
// Try to find a key that matches
// Try to find a key that matches
#if NET20
Models.PortableExecutable.StringData? match = null;
foreach (var st in stringTable)
{
if (st?.Children == null)
continue;
Models.PortableExecutable.StringData? match = null;
foreach (var st in stringTable)
{
if (st?.Children == null)
continue;
// Return the match if found
match = Array.Find(st.Children, sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
if (match != null)
{
_versionInfoStrings[key] = match.Value?.TrimEnd('\0');
return _versionInfoStrings[key];
}
}
_versionInfoStrings[key] = null;
return _versionInfoStrings[key];
#else
var match = stringTable
.SelectMany(st => st?.Children ?? [])
.FirstOrDefault(sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
// Return either the match or null
_versionInfoStrings[key] = match?.Value?.TrimEnd('\0');
return _versionInfoStrings[key];
#endif
// Return the match if found
match = Array.Find(st.Children, sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
if (match != null)
return match.Value?.TrimEnd('\0');
}
return null;
#else
var match = stringTable
.SelectMany(st => st?.Children ?? [])
.FirstOrDefault(sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
// Return either the match or null
return match?.Value?.TrimEnd('\0');
#endif
}
/// <summary>