-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose Hash::Object/Hash::Typed roles (#4013)
These roles used to be internal to the Hash class. By exposing them it is possible to use them for easy typechecking and dispatch. This makes the rather esoteric check: nqp::eqaddr(foo.keyof,Str(Any)) much more readable as: nqp::istype(foo,Hash::Object) albeit with inverted meaning, of course, This check is about 2x as fast as the nqp::eqaddr version. Still it is little work, but some of these happen in potentially hot code paths in set operator handling. For easier maintainability, these roles have been put into separate source-files. This commit also changes all places where the faster Hash::Object check could be used, and adds the two new visible roles in the core tests.
- Loading branch information
Showing
13 changed files
with
515 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.