Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[housekeeping] Automated PR to fix formatting errors #18554

Merged
merged 1 commit into from Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Core/src/Handlers/Layout/LayoutExtensions.cs
Expand Up @@ -20,13 +20,14 @@ public static int GetLayoutHandlerIndex(this ILayout layout, IView view)
var found = false;
var zIndex = view.ZIndex;
var lowerViews = 0;

for (int i = 0; i < count; i++)
{
var child = layout[i];
var childZIndex = child.ZIndex;

if (child == view) {
if (child == view)
{
found = true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Core/tests/Benchmarks/Benchmarks/LayoutBenchmarker.cs
Expand Up @@ -12,14 +12,14 @@ public class LayoutBenchmarker
new Border(), new Border(), new Border(), new Border(), new Border(), new Border(), new Border(),
new Border(), new Border(), new Border(), new Border(), new Border(), new Border(), new Border()
};

static readonly int Iterations = Views.Length;

[Benchmark]
public void GetLayoutHandlerIndex()
{
var layout = new VerticalStackLayout();

for (int i = 0; i < Iterations; i++)
{
var view = Views[i];
Expand Down
8 changes: 4 additions & 4 deletions src/Core/tests/UnitTests/Layouts/ZIndexTests.cs
Expand Up @@ -200,19 +200,19 @@ public void LayoutHandlerIndexFollowsAddOrderWhenZIndexesAreEqual()
Assert.Equal(2, layout.GetLayoutHandlerIndex(view2));
Assert.Equal(3, layout.GetLayoutHandlerIndex(view3));
}

[Fact]
public void LayoutHandlerIndexIsNegativeWhenChildIsNotFound()
{
var layout = new FakeLayout();
var view0 = CreateTestView(zIndex: 0);

Assert.Equal(-1, layout.GetLayoutHandlerIndex(view0));

layout.Add(CreateTestView(zIndex: 0));
Assert.Equal(-1, layout.GetLayoutHandlerIndex(view0));


layout.Add(CreateTestView(zIndex: 0));
Assert.Equal(-1, layout.GetLayoutHandlerIndex(view0));
}
Expand Down