Skip to content

Commit

Permalink
Avoid more unrequired descriptor checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Aug 7, 2018
1 parent 37c7e6e commit 90f678f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/core/Any.pm6
Expand Up @@ -251,10 +251,10 @@ my class Any { # declared in BOOTSTRAP

proto method AT-POS(|) is nodal {*}
multi method AT-POS(Any:U \SELF: int \pos) is raw {
nqp::p6scalarfromdesc(ContainerDescriptor::VivifyArray.new(SELF, pos))
nqp::p6scalarfromcertaindesc(ContainerDescriptor::VivifyArray.new(SELF, pos))
}
multi method AT-POS(Any:U \SELF: Int:D \pos) is raw {
nqp::p6scalarfromdesc(ContainerDescriptor::VivifyArray.new(SELF, pos))
nqp::p6scalarfromcertaindesc(ContainerDescriptor::VivifyArray.new(SELF, pos))
}
multi method AT-POS(Any:U: Num:D \pos) is raw {
nqp::isnanorinf(pos)
Expand Down Expand Up @@ -385,7 +385,7 @@ my class Any { # declared in BOOTSTRAP
)
}
multi method AT-KEY(Any:U \SELF: \key) is raw {
nqp::p6scalarfromdesc(ContainerDescriptor::VivifyHash.new(SELF, key))
nqp::p6scalarfromcertaindesc(ContainerDescriptor::VivifyHash.new(SELF, key))
}

proto method BIND-KEY(|) is nodal {*}
Expand Down
14 changes: 7 additions & 7 deletions src/core/Array.pm6
Expand Up @@ -137,7 +137,7 @@ my class Array { # declared in BOOTSTRAP
)
}
method hole(int $i) {
nqp::p6scalarfromdesc(ContainerDescriptor::BindArrayPos.new(
nqp::p6scalarfromcertaindesc(ContainerDescriptor::BindArrayPos.new(
$!descriptor, $!reified, $i))
}
method done() is raw {
Expand Down Expand Up @@ -331,7 +331,7 @@ my class Array { # declared in BOOTSTRAP
multi method AT-POS(Int:D \pos) {
nqp::ifnull(
nqp::atpos(nqp::getattr(self,List,'$!reified'),pos),
nqp::p6scalarfromdesc(ContainerDescriptor::BindArrayPos.new(
nqp::p6scalarfromcertaindesc(ContainerDescriptor::BindArrayPos.new(
$!descriptor, nqp::getattr(self,List,'$!reified'), pos))
)
}
Expand Down Expand Up @@ -386,7 +386,7 @@ my class Array { # declared in BOOTSTRAP
nqp::bindpos(
$reified,
$i,
nqp::p6scalarfromdesc($!descriptor)
nqp::p6scalarfromcertaindesc($!descriptor)
)
)
)
Expand Down Expand Up @@ -551,7 +551,7 @@ my class Array { # declared in BOOTSTRAP
nqp::bindpos(
nqp::getattr(self,List,'$!reified'),
$pos,
nqp::p6scalarfromdesc($!descriptor)
nqp::p6scalarfromcertaindesc($!descriptor)
),
nqp::if(
nqp::isconcrete(nqp::getattr(self,List,'$!todo')),
Expand All @@ -566,22 +566,22 @@ my class Array { # declared in BOOTSTRAP
nqp::bindpos( # outlander
nqp::getattr(self,List,'$!reified'),
$pos,
nqp::p6scalarfromdesc($!descriptor)
nqp::p6scalarfromcertaindesc($!descriptor)
)
)
),
nqp::bindpos( # outlander without todo
nqp::getattr(self,List,'$!reified'),
$pos,
nqp::p6scalarfromdesc($!descriptor)
nqp::p6scalarfromcertaindesc($!descriptor)
)
)
)
),
nqp::bindpos( # new outlander
nqp::bindattr(self,List,'$!reified',nqp::create(IterationBuffer)),
$pos,
nqp::p6scalarfromdesc($!descriptor)
nqp::p6scalarfromcertaindesc($!descriptor)
)
) = assignee
)
Expand Down

0 comments on commit 90f678f

Please sign in to comment.