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