Skip to content

Commit

Permalink
Remove unneeded !uname method
Browse files Browse the repository at this point in the history
nqp::uname will do just fine
  • Loading branch information
lizmat committed Jan 22, 2020
1 parent 86a771a commit 4cecc47
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/core.c/Kernel.pm6
Expand Up @@ -9,16 +9,9 @@ class Kernel does Systemic {
has Str $!arch;
has Int $!bits;

#?if !jvm
has $!uname;
method !uname {
$!uname ?? $!uname !! ($!uname := nqp::uname())
}
#?endif

method !uname-s {
#?if !jvm
nqp::atpos_s(self!uname, nqp::const::UNAME_SYSNAME)
nqp::atpos_s(nqp::uname(), nqp::const::UNAME_SYSNAME)
#?endif
#?if jvm
try shell('uname -s', :out, :!err).out.slurp(:close).chomp;
Expand All @@ -27,7 +20,7 @@ class Kernel does Systemic {

method !uname-r {
#?if !jvm
nqp::atpos_s(self!uname, nqp::const::UNAME_RELEASE)
nqp::atpos_s(nqp::uname(), nqp::const::UNAME_RELEASE)
#?endif
#?if jvm
try shell('uname -r', :out, :!err).out.slurp(:close).chomp;
Expand All @@ -36,7 +29,7 @@ class Kernel does Systemic {

method !uname-v {
#?if !jvm
nqp::atpos_s(self!uname, nqp::const::UNAME_VERSION)
nqp::atpos_s(nqp::uname(), nqp::const::UNAME_VERSION)
#?endif
#?if jvm
try shell('uname -v', :out, :!err).out.slurp(:close).chomp;
Expand All @@ -45,7 +38,7 @@ class Kernel does Systemic {

method !uname-m {
#?if !jvm
nqp::atpos_s(self!uname, nqp::const::UNAME_MACHINE)
nqp::atpos_s(nqp::uname(), nqp::const::UNAME_MACHINE)
#?endif
#?if jvm
try shell('uname -m', :out, :!err).out.slurp(:close).chomp;
Expand Down

2 comments on commit 4cecc47

@ugexe
Copy link
Member

@ugexe ugexe commented on 4cecc47 Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are not caching things that are cacheable anymore? That seems a tad strange given the type of minor performance improvements we seem to continue implementing for the greater good. Shall we go through and change other areas using a private attribute for caching?

@lizmat
Copy link
Contributor Author

@lizmat lizmat commented on 4cecc47 Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You raise a good point. I underestimated the weight of nqp::uname

Shall we go through and change other areas using a private attribute for caching?"

But could you please refrain from passive aggressive tone? I assume you're still upset with regards to the Raku name change and would have rather seen that I had not suggested that. Are there other things you are upset with me about? Then please tell me about them.

Please sign in to comment.