Permalink
Browse files

Remove uses of eval to convert rational strings to Rats; using defaul…

…t .Numeric is vastly faster in Niecza.
  • Loading branch information...
1 parent 28d8d1a commit 664f368a9065f40ee09d4131cf6f2dde2716de01 @colomon committed May 20, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/abc2ly.pl
View
@@ -83,8 +83,8 @@
method ticks-in-measure() {
given $.meter {
- when "C" | "C|" { 1 / $.length.eval; }
- $.meter.eval / $.length.eval;
+ when "C" | "C|" { 1 / $.length; }
+ $.meter / $.length;
}
}
@@ -170,7 +170,7 @@ (ABC::Header $header, $out)
my $ticks-in-measure = $.context.ticks-in-measure;
my $result = "";
if $duration % $ticks-in-measure != 0 {
- my $note-length = 1 / $.context.length.eval;
+ my $note-length = 1 / $.context.length;
my $count = $duration % $ticks-in-measure;
if $count ~~ Rat {
die "Strange partial measure found: $lilypond-bar" unless is-a-power-of-two($count.denominator);

0 comments on commit 664f368

Please sign in to comment.