Created
September 16, 2015 10:34
-
-
Save Tux/bcaaa0d9902b0993bf92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
method to_list () { | |
lazy gather { | |
my Int $max = -1; | |
for sort @!ranges -> $r { | |
my $from = ($r.key, $max + 1).max.Int; | |
my $to = $r.value;# == Inf ?? 65535 !! $r.value; | |
take (($from .. $to).Slip); | |
$r.value == Inf and last; | |
$max = ($max, $r.value).max.Int; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment