Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some "is raw" to AT-POS methods
They seem to need it.
  • Loading branch information
lizmat committed Oct 21, 2015
1 parent 5e8e234 commit 26617f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/Buf.pm
Expand Up @@ -251,12 +251,12 @@ my class utf32 does Blob[uint32] is repr('VMArray') {
}

my role Buf[::T = uint8] does Blob[T] is repr('VMArray') is array_type(T) {
multi method AT-POS(Buf:D: int \pos) {
multi method AT-POS(Buf:D: int \pos) is raw {
fail X::OutOfRange.new(:what<Index>,:got(pos),:range<0..Inf>)
if nqp::islt_i(pos,0);
nqp::atposref_i(self, pos);
}
multi method AT-POS(Buf:D: Int:D \pos) {
multi method AT-POS(Buf:D: Int:D \pos) is raw {
my int $pos = nqp::unbox_i(pos);
fail X::OutOfRange.new(:what<Index>,:got(pos),:range<0..Inf>)
if nqp::islt_i($pos,0);
Expand Down
4 changes: 2 additions & 2 deletions src/core/IterationBuffer.pm
Expand Up @@ -23,10 +23,10 @@ my class IterationBuffer {
nqp::push(self, value)
}

multi method AT-POS(IterationBuffer:D: int $pos) {
multi method AT-POS(IterationBuffer:D: int $pos) is raw {
nqp::atpos(self, $pos)
}
multi method AT-POS(IterationBuffer:D: Int $pos) {
multi method AT-POS(IterationBuffer:D: Int $pos) is raw {
nqp::atpos(self, $pos)
}

Expand Down

0 comments on commit 26617f9

Please sign in to comment.