Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

[Proposal] Generic accessor into feature collection #525

Closed
wants to merge 2 commits into from

Conversation

benaadams
Copy link
Contributor

Also making the FeatureInterfaces structs public and checking for those means the IGetConcreteStructWrapped fast path can be done in Frame.FastFeatureGet<T> (half speed of having no branches)

Resolves #522

public TFeature Get<TFeature>()
{
var type = typeof(TFeature);
if (type.GetTypeInfo().IsValueType)
Copy link
Member

Choose a reason for hiding this comment

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

Why this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(TFeature)this[type] blows up if its a struct and not in the collection with a NRE

benaadams added a commit to benaadams/KestrelHttpServer that referenced this pull request Dec 31, 2015
@benaadams benaadams closed this Dec 31, 2015
@benaadams benaadams deleted the faster-feature-collection branch May 10, 2016 11:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants