Skip to content

Commit

Permalink
perf(UIComponent): use cached Task when no layouts are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jonisavo committed May 8, 2023
1 parent e8a2c60 commit 1d2edd4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Assets/UIComponents/Core/UIComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ public IEnumerator WaitForInitializationEnumerator()
return _dependencyInjector.TryProvide(out instance);
}

private static readonly Task<VisualTreeAsset> NullLayoutTask =
Task.FromResult<VisualTreeAsset>(null);

protected virtual Task<VisualTreeAsset> UIC_StartLayoutLoad()
{
return Task.FromResult<VisualTreeAsset>(null);
return NullLayoutTask;
}

protected readonly struct StyleSheetLoadTuple
Expand Down

0 comments on commit 1d2edd4

Please sign in to comment.