Skip to content

Commit

Permalink
s/Iterator/PredictiveIterator for Range
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 9, 2018
1 parent 000ac81 commit c2c9df1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/Range.pm6
Expand Up @@ -173,7 +173,7 @@ my class Range is Cool does Iterable does Positional {
multi method list(Range:D:) { List.from-iterator(self.iterator) }
method flat(Range:D:) { Seq.new(self.iterator) }

my class NativeIntReverse does Iterator {
my class NativeIntReverse does PredictiveIterator {
has int $!i;
has int $!n;

Expand All @@ -190,7 +190,6 @@ my class Range is Cool does Iterable does Positional {
$!i = $i;
}
method count-only() { nqp::p6box_i($!i - $!n) }
method bool-only() { nqp::hllbool(nqp::isgt_i($!i,$!n)) }
method sink-all(--> IterationEnd) { $!i = $!n }
}
my class InfReverse does Iterator {
Expand All @@ -206,7 +205,7 @@ my class Range is Cool does Iterable does Positional {
method pull-one() { $!i-- }
method is-lazy() { True }
}
my class CharReverse does Iterator {
my class CharReverse does PredictiveIterator {
has int $!i;
has int $!n;

Expand All @@ -230,7 +229,6 @@ my class Range is Cool does Iterable does Positional {
$!i = $i;
}
method count-only() { nqp::p6box_i($!i - $!n) }
method bool-only() { nqp::hllbool(nqp::isgt_i($!i,$!n)) }
method sink-all(--> IterationEnd) { $!i = $!n }
}
my class Pred does Iterator {
Expand Down

0 comments on commit c2c9df1

Please sign in to comment.