-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: code clean up, optimizing string comparison
- Loading branch information
Showing
21 changed files
with
119 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Description>Provides a complete diffing model of HTML.</Description> | ||
<Product>AngleSharp.Diffing</Product> | ||
<Authors>AngleSharp</Authors> | ||
<PackageId>AngleSharp.Diffing</PackageId> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageProjectUrl>https://anglesharp.github.io</PackageProjectUrl> | ||
<PackageIcon>logo.png</PackageIcon> | ||
<PackageIconUrl>https://raw.github.com/AngleSharp/AngleSharp.Diffing/master/logo.png</PackageIconUrl> | ||
<PackageTags>html html5 css css3 dom library diffing anglesharp diff difference compare comparison testing</PackageTags> | ||
<Copyright>Egil Hansen</Copyright> | ||
<RepositoryUrl>https://github.com/AngleSharp/AngleSharp.Diffing</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<Description>Provides a complete diffing model of HTML.</Description> | ||
<Product>AngleSharp.Diffing</Product> | ||
<Authors>AngleSharp</Authors> | ||
<PackageId>AngleSharp.Diffing</PackageId> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageProjectUrl>https://anglesharp.github.io</PackageProjectUrl> | ||
<PackageIcon>logo.png</PackageIcon> | ||
<PackageIconUrl>https://raw.github.com/AngleSharp/AngleSharp.Diffing/master/logo.png</PackageIconUrl> | ||
<PackageTags>html html5 css css3 dom library diffing anglesharp diff difference compare comparison testing</PackageTags> | ||
<Copyright>Egil Hansen</Copyright> | ||
<RepositoryUrl>https://github.com/AngleSharp/AngleSharp.Diffing</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" /> | ||
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[5.0.0]" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.169"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" /> | ||
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[5.0.0]" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\logo.png" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="..\..\logo.png" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace AngleSharp.Diffing.Core; | ||
|
||
/// <summary> | ||
/// Helper methods for <see cref="FilterDecision"/>. | ||
/// </summary> | ||
public static class FilterDecisionExtensions | ||
{ | ||
/// <summary> | ||
/// Gets whether the <see cref="FilterDecision"/> is <see cref="FilterDecision.Exclude"/>. | ||
/// </summary> | ||
public static bool IsExclude(this FilterDecision decision) => decision == FilterDecision.Exclude; | ||
|
||
/// <summary> | ||
/// Gets whether the <see cref="FilterDecision"/> is <see cref="FilterDecision.Keep"/>. | ||
/// </summary> | ||
public static bool IsKeep(this FilterDecision decision) => decision == FilterDecision.Keep; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace AngleSharp.Diffing.Core; | ||
|
||
/// <summary> | ||
/// Helper methods for working with <see cref="DiffTarget"/>. | ||
/// </summary> | ||
public static class NodeTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Gets the diff target based on the node type. | ||
/// </summary> | ||
/// <param name="nodeType">Mode type to get the diff target off.</param> | ||
public static DiffTarget ToDiffTarget(this NodeType nodeType) | ||
{ | ||
return nodeType switch | ||
{ | ||
NodeType.Element => DiffTarget.Element, | ||
NodeType.Comment => DiffTarget.Comment, | ||
NodeType.Text => DiffTarget.Text, | ||
_ => DiffTarget.Node | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.