Permalink
Browse files

speed up eqv for Buf

  • Loading branch information...
1 parent fdbba70 commit 8369e63a8f6bc61a03689ae3980e3174ca8eefbd @moritz moritz committed Feb 13, 2013
Showing with 5 additions and 1 deletion.
  1. +1 −0 docs/ChangeLog
  2. +4 −1 src/core/Buf.pm
View
@@ -10,6 +10,7 @@ New in 2013.02
+ natively typed variables now work in the REPL
+ better error reporting in the REPL
+ writable $_ in -p and -e one-liner
++ speed up eqv-comparison of Bufs
New in 2013.01
+ sink context; for-loops are now lazy by default
View
@@ -150,7 +150,10 @@ my class Buf does Positional {
}
multi infix:<eqv>(Buf:D $a, Buf:D $b) {
- $a.WHAT === $b.WHAT && $a.list eqv $b.list;
+ $a.WHAT === $b.WHAT && nqp::p6bool(nqp::iseq_s(
+ nqp::getattr_s(nqp::p6decont($a), Buf, '$!buffer'),
+ nqp::getattr_s(nqp::p6decont($b), Buf, '$!buffer')
+ ));
}
multi prefix:<~^>(Buf:D $a) {
Buf.new($a.list.map: 255 - *);

0 comments on commit 8369e63

Please sign in to comment.