Skip to content
Permalink
Browse files

Remove unnecessary code

Probably stuck around from a different path in the to-json refactor.
  • Loading branch information...
lizmat committed Jun 1, 2019
1 parent b20ccba commit a6a2ba90f9dc9b3af7855647b78ceefa4d853274
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/core/Rakudo/Internals/JSON.pm6
@@ -80,12 +80,11 @@ my class Rakudo::Internals::JSON {
nqp::push_s(@out,'[');
nqp::push_s(@out,nqp::substr($comma,1));

my int $before = nqp::elems(@out);
for positional.list {
jsonify($_);
nqp::push_s(@out,$comma);
}
nqp::pop_s(@out) if nqp::elems(@out) > $before; # lose last comma
nqp::pop_s(@out); # lose last comma

$comma = nqp::substr($comma,0,nqp::sub_i(nqp::chars($comma),$spacing));
nqp::push_s(@out,nqp::substr($comma,1));
@@ -100,14 +99,13 @@ my class Rakudo::Internals::JSON {
?? associative.sort(*.key)
!! associative.list;

my int $before = nqp::elems(@out);
for pairs {
jsonify(.key);
nqp::push_s(@out,": ");
jsonify(.value);
nqp::push_s(@out,$comma);
}
nqp::pop_s(@out) if nqp::elems(@out) > $before; # lose last comma
nqp::pop_s(@out); # lose last comma

$comma = nqp::substr($comma,0,nqp::sub_i(nqp::chars($comma),$spacing));
nqp::push_s(@out,nqp::substr($comma,1));

0 comments on commit a6a2ba9

Please sign in to comment.
You can’t perform that action at this time.