Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

[new AA] core.internal.hash fixes#932

Merged
MartinNowak merged 1 commit intodlang:masterfrom
IgorStepanov:newaa-hashof-fixes
Sep 5, 2014
Merged

[new AA] core.internal.hash fixes#932
MartinNowak merged 1 commit intodlang:masterfrom
IgorStepanov:newaa-hashof-fixes

Conversation

@IgorStepanov
Copy link
Contributor

This PR contains the follownig changes:

  1. some hashOf functions has unmarked with @trusted nothrow: we can't guarantee that struct hashOf is @trusted or nothrow.
  2. typedef support added: current AA implementation supports typedef keys (deprecated but allowed), and dmd tests checks that typedef keys are allowed.
  3. typeof(null) case for hashOf added.
  4. seedHash has unmarked with private, because this function is usefull for hash chaining inside user toHash
  5. if struct has toHash member, but it cannot be called with passed this hashOf writes warning, but doesn't raise error. (for backward compatibility: current AA implementation ingores wrong toHash in this case)
  6. pass value by ref into foreach in hashOf for AA: avoid to call postblit.

@IgorStepanov IgorStepanov changed the title [new AA] core.internal.convert; [new AA] core.internal.hash fixes Aug 22, 2014
Copy link
Member

Choose a reason for hiding this comment

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

I take it that being a template hashOf relies on deduction? Is it necessary to keep commented out attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... Yes. This comments isn't necessary. I'll remove them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Ehm? Shouldn't we just remove or fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll remove this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@DmitryOlshansky
Copy link
Member

Looks fine, I'd rather wait on one of druntime guys to take a look though ;)

P.S. Any unittests for this stuff?

@IgorStepanov
Copy link
Contributor Author

I've add test for typeof(null);
I don't want to add typedef tests, because typedef is deprecated.

@IgorStepanov
Copy link
Contributor Author

@MartinNowak ping

@MartinNowak MartinNowak merged commit 463c9d5 into dlang:master Sep 5, 2014
MartinNowak added a commit that referenced this pull request Sep 5, 2014
@IgorStepanov
Copy link
Contributor Author

Thanks!

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