Skip to content

Use a switch instead of a global dictionary for primitiveTypeInfo#6015

Merged
dlang-bot merged 1 commit into
dlang:masterfrom
wilzbach:format-switch
Jan 8, 2018
Merged

Use a switch instead of a global dictionary for primitiveTypeInfo#6015
dlang-bot merged 1 commit into
dlang:masterfrom
wilzbach:format-switch

Conversation

@wilzbach

@wilzbach wilzbach commented Jan 8, 2018

Copy link
Copy Markdown
Contributor

Discovered while working on #6014

@wilzbach wilzbach requested a review from andralex as a code owner January 8, 2018 18:10
@dlang-bot

Copy link
Copy Markdown

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@quickfur quickfur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

Only question is, how is typeid(...) implemented? Just wondering if the reason for the global hash is to prevent excessive recomputation, if typeid(...) has a complex implementation. But if it's just returning a pre-made object, then it's probably OK.

@quickfur quickfur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, just checked the disassembly. It does just return a static object. So we're good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants