Switch to JSON::MaybeXS
[app-musicexpo.git] / lib / App / MusicExpo.pm
index 242e0df0cd19d66cba78cc883ad27b3c965edfb6..ef99911562494db12f098cdc34bd9016ce0d12bd 100644 (file)
@@ -15,7 +15,7 @@ use DB_File qw//;
 use File::Basename qw/fileparse/;
 use Fcntl qw/O_RDWR O_CREAT/;
 use Getopt::Long;
-use JSON;
+use JSON::MaybeXS;
 use Storable qw/thaw freeze/;
 
 ##################################################
@@ -129,7 +129,7 @@ sub run {
                push @files, \%entry
        }
 
-       my $json = JSON->new->utf8->canonical->encode({files => \@files, prefix => $prefix});
+       my $json = JSON::MaybeXS->new(canonical => 1)->encode({files => \@files, prefix => $prefix});
        $json =~ s/</&lt;/g;
        $json =~ s/>/&gt;/g;
        $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix, json => $json);
This page took 0.010176 seconds and 4 git commands to generate.