mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-07-15 13:57:56 +08:00
Use statically initialized data
This commit is contained in:
parent
4653671b2d
commit
e508d6714e
@ -15,15 +15,15 @@
|
||||
private const byte Offset = (byte)'!';
|
||||
private const byte EmptyCharacterPadding = (byte) 'u';
|
||||
|
||||
private static readonly byte[] EndOfDataBytes = { (byte)'~', (byte)'>' };
|
||||
private static ReadOnlySpan<byte> EndOfDataBytes => [(byte)'~', (byte)'>'];
|
||||
|
||||
private static readonly int[] PowerByIndex = {
|
||||
private static readonly int[] PowerByIndex = [
|
||||
1,
|
||||
85,
|
||||
85 * 85,
|
||||
85 * 85 * 85,
|
||||
85 * 85 * 85 *85
|
||||
};
|
||||
];
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsSupported { get; } = true;
|
||||
|
@ -26,18 +26,7 @@
|
||||
/// </summary>
|
||||
private const int EndOfFileSearchRange = 2048;
|
||||
|
||||
private static readonly byte[] StartXRefBytes =
|
||||
{
|
||||
(byte) 's',
|
||||
(byte) 't',
|
||||
(byte) 'a',
|
||||
(byte) 'r',
|
||||
(byte) 't',
|
||||
(byte) 'x',
|
||||
(byte) 'r',
|
||||
(byte) 'e',
|
||||
(byte) 'f'
|
||||
};
|
||||
private static ReadOnlySpan<byte> StartXRefBytes => "startxref"u8;
|
||||
|
||||
public static long GetFirstCrossReferenceOffset(IInputBytes bytes, ISeekableTokenScanner scanner, bool isLenientParsing)
|
||||
{
|
||||
|
@ -31,7 +31,11 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)'=='net462' OR '$(TargetFramework)'=='net47'">
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.5" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
|
||||
<PackageReference Include="System.Memory" Version="4.5.5" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UglyToad.PdfPig.Core\UglyToad.PdfPig.Core.csproj" />
|
||||
<ProjectReference Include="..\UglyToad.PdfPig.Fonts\UglyToad.PdfPig.Fonts.csproj" />
|
||||
|
Loading…
Reference in New Issue
Block a user