Permalink
Browse files

no need to be paranoid about extra stringification anymore

  • Loading branch information...
1 parent 0eb4c8e commit fb102c3841571ed7aa470473df41c498eb7f86dd @moritz committed Dec 21, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/JSON/Tiny.pm
View
@@ -42,7 +42,7 @@ multi to-json(Str:D $d) {
;
'"'
- ~ (~$d).subst(/<["\\\b\f\n\r\t]>/, { %esc{$_} }, :g)\
+ ~ $d.subst(/<["\\\b\f\n\r\t]>/, -> $/ { %esc{$/} }, :g)\
.subst(/<-[\ ..~]>/, { ord(~$_).fmt('\u%04x') }, :g)
~ '"'
}

0 comments on commit fb102c3

Please sign in to comment.