Skip to content

Commit

Permalink
Improved memory performance of TextColorToGenerator (#1254)
Browse files Browse the repository at this point in the history
* Avoiding boxing enumerators of built-in types and also unrolled this LINQ expression, both of which reduce memory allocations thus improving GC behavior.

* Replaced null check with ‘is’ instead of ‘==‘.

* Update azure-pipelines.yml

* Fix Vulnerable Tizen Dependency

* Change `SkiaSharp` -> `SkiaSharp.Views` and move it to `CommunityToolkit.Maui.Core`

---------

Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
  • Loading branch information
AllenD-MSFT and brminnick committed Sep 22, 2023
1 parent cfc7832 commit bf9d66d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Expand Up @@ -257,7 +257,8 @@ jobs:

# check vulnerabilities
- powershell: |
dotnet list $(PathToLibrarySolution) package --vulnerable --include-transitive | findstr /S /c:"has the following vulnerable packages";
dotnet list $(PathToLibrarySolution) package --include-transitive # Print all transitive packages
dotnet list $(PathToLibrarySolution) package --vulnerable --include-transitive | findstr /S /c:"has the following vulnerable packages"; # Print all transitive packages with vulnerabilities
if ($LastExitCode -ne 1)
{
dotnet list $(PathToLibrarySolution) package --vulnerable --include-transitive;
Expand Down
Expand Up @@ -50,6 +50,10 @@
<None Include="ReadMe.txt" pack="true" PackagePath="." />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-tizen'))">
<PackageReference Include="SkiaSharp.Views" Version="[2.88.6,)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
Expand Up @@ -68,7 +68,24 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
throw new Exception("There's no .NET MAUI referenced in the project.");
}
var mauiAssembly = compilation.SourceModule.ReferencedAssemblySymbols.Single(q => q.Name == mauiControlsAssembly);
var mauiAssembly = default(IAssemblySymbol);
foreach (var assemblySymbol in compilation.SourceModule.ReferencedAssemblySymbols)
{
if (assemblySymbol.Name == mauiControlsAssembly)
{
if (mauiAssembly is not null)
{
throw new InvalidOperationException("There can only be one reference to the Maui Controls assembly.");
}
mauiAssembly = assemblySymbol;
}
}
if (mauiAssembly is null)
{
throw new InvalidOperationException("There is no reference to the Maui Controls assembly.");
}
var symbols = GetMauiInterfaceImplementors(mauiAssembly, iAnimatableInterfaceSymbol, iTextStyleInterfaceSymbol).Where(static x => x is not null);
return symbols;
Expand Down

0 comments on commit bf9d66d

Please sign in to comment.