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

Split Container into a generic and a non-generic part #872

Merged
merged 12 commits into from Jul 8, 2017

Conversation

Tom94
Copy link
Collaborator

@Tom94 Tom94 commented Jul 5, 2017

This simplification of the code has surprisingly powerful performance and convenience implications. IContainer is no longer needed, and common container methods / properties can now be accessed without virtual dispatch. Further, due to the simplified casting, it is now possible to flatten the DrawNode tree of generic containers; neat! Lastly, due to the avoidance of IContainer, some members can now have non-public visibility, such as InternalChildren et al.. This allows making containers which manage their own children and disallow adding / removing from outside.

Tom94 added 12 commits July 5, 2017 17:24
This simplification of the code has surprisingly powerful performance
and convenience implications. IContainer is no longer needed, and
common container methods / properties can now be accessed without
virtual dispatch. Further, due to the simplified casting, it is now
possible to flatten the DrawNode hierarchy of generic containers,
neat! Lastly, due to the avoidance of IContainer some members
can now have non-public visibility, such as InternalChildren et al.
This allows making containers which manage their own children
and disallow adding / removing from outside.
This improves performance since it seems like the runtime
isn't smart enough to properly optimize a nested enumerator.
Since it does not allow adding children from outside, it's pointless
to allow instantiation.
Also updates XML docs
They are re-exposed in Container via new
…ntainer-split

# Conflicts:
#	osu.Framework/Graphics/Containers/Container.cs
…ntainer-split

# Conflicts:
#	osu.Framework/osu.Framework.csproj
@peppy peppy merged commit 2b6b2a8 into ppy:master Jul 8, 2017
@Tom94 Tom94 deleted the container-split branch November 14, 2019 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants