Skip to content

Commit

Permalink
Fetch a str attribute with nqp::getattr_s instead of nqp::getattr
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Feb 13, 2018
1 parent 697e95c commit 70d1359
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/QRegex/Cursor.nqp
Expand Up @@ -86,8 +86,8 @@ role NQPMatchRole is export {
method pos() { $!pos }
method to() { $!to < 0 ?? $!pos !! $!to }
method CURSOR() { self }
method PRECURSOR() { self."!cursor_init"(nqp::getattr($!shared, ParseShared, '$!target'), :p($!from)) }
method Str() { $!pos >= $!from ?? nqp::substr(nqp::getattr($!shared, ParseShared, '$!target'), $!from, nqp::sub_i(self.to, $!from)) !! '' }
method PRECURSOR() { self."!cursor_init"(nqp::getattr_s($!shared, ParseShared, '$!target'), :p($!from)) }
method Str() { $!pos >= $!from ?? nqp::substr(nqp::getattr_s($!shared, ParseShared, '$!target'), $!from, nqp::sub_i(self.to, $!from)) !! '' }
method Num() { +self.Str() }
method Bool() { $!pos >= $!from }
method chars() { $!pos >= $!from ?? nqp::sub_i(self.to, $!from) !! 0 }
Expand Down

0 comments on commit 70d1359

Please sign in to comment.