Skip to content

Commit

Permalink
Micro-opt .subst call in INITIALIZE-A-DISTRO-NOW
Browse files Browse the repository at this point in the history
We don't need to use a regex here and Str matcher with :g will fast-path
  • Loading branch information
zoffixznet committed Jun 17, 2017
1 parent a5be845 commit 46eecda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Distro.pm
Expand Up @@ -63,7 +63,7 @@ sub INITIALIZE-A-DISTRO-NOW() {
$auth := 'Apple Computer, Inc.'; # presumably
}
elsif Rakudo::Internals.FILETEST-E('/etc/os-release') {
$_ := '/etc/os-release'.IO.slurp.subst(:g, /'"'/,'');
$_ := '/etc/os-release'.IO.slurp.subst(:g, '"','');
$auth := ~$0 if m/^^ HOME_URL \= (\N*) /;
$name := ~$0 if m/^^ ID \= (\N*) /;
$version := ~$0 if m/^^ VERSION \= (\N*) /;
Expand Down

0 comments on commit 46eecda

Please sign in to comment.