Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Fix diffing when "bind" is combined with conditional attribute. Fixes #624 #633

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

SteveSandersonMS
Copy link
Member

The issue was that we were using incorrect logic to update the indices during the attribute diffing. The problem only manifests given a very specific diffing scenario because of a fluke in how the memory for a RenderTreeFrame is laid out.

Fortunately the fixed code is much simpler. And we get a minor perf boost for free.

oldStartIndex = NextSiblingIndex(oldTree[oldStartIndex], oldStartIndex);
newStartIndex = NextSiblingIndex(newTree[newStartIndex], newStartIndex);
oldStartIndex++;
newStartIndex++;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should always have just been "++" here, since attribute frames are always a continuous flat list. Attributes don't have descendants to skip over.

Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good to me. I'm not sure I completely understand the sibling index conceptually yes

@SteveSandersonMS SteveSandersonMS merged commit 933029c into dev Apr 20, 2018
@SteveSandersonMS SteveSandersonMS deleted the stevesa/fix-attribute-diffing branch April 20, 2018 21:49
@SteveSandersonMS SteveSandersonMS added this to the 0.3.0 milestone Apr 23, 2018
@WojcikMM
Copy link

WojcikMM commented May 8, 2019

Still Not Working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants