Skip to content

Commit 70d1359

Browse files
committed
Fetch a str attribute with nqp::getattr_s instead of nqp::getattr
1 parent 697e95c commit 70d1359

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QRegex/Cursor.nqp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ role NQPMatchRole is export {
8686
method pos() { $!pos }
8787
method to() { $!to < 0 ?? $!pos !! $!to }
8888
method CURSOR() { self }
89-
method PRECURSOR() { self."!cursor_init"(nqp::getattr($!shared, ParseShared, '$!target'), :p($!from)) }
90-
method Str() { $!pos >= $!from ?? nqp::substr(nqp::getattr($!shared, ParseShared, '$!target'), $!from, nqp::sub_i(self.to, $!from)) !! '' }
89+
method PRECURSOR() { self."!cursor_init"(nqp::getattr_s($!shared, ParseShared, '$!target'), :p($!from)) }
90+
method Str() { $!pos >= $!from ?? nqp::substr(nqp::getattr_s($!shared, ParseShared, '$!target'), $!from, nqp::sub_i(self.to, $!from)) !! '' }
9191
method Num() { +self.Str() }
9292
method Bool() { $!pos >= $!from }
9393
method chars() { $!pos >= $!from ?? nqp::sub_i(self.to, $!from) !! 0 }

0 commit comments

Comments
 (0)