From ca63fda5c00be899de8feac6db65a25c5ae8f521 Mon Sep 17 00:00:00 2001 From: Jeff Ober Date: Fri, 17 Jan 2020 10:03:32 -0500 Subject: [PATCH] Fix bug in generation of nested table-arrays --- lib/TOML/Tiny/Writer.pm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/TOML/Tiny/Writer.pm b/lib/TOML/Tiny/Writer.pm index f9fb9c9..7c3067b 100644 --- a/lib/TOML/Tiny/Writer.pm +++ b/lib/TOML/Tiny/Writer.pm @@ -68,18 +68,7 @@ sub to_toml { for (@table_array) { push @buff, '', '[[' . join('.', map{ to_toml_key($_) } @KEYS) . ']]'; - - for my $k (sort keys %$_) { - my $key = to_toml_key($k); - my $val = to_toml($_->{$k}, %param); - - unless ($val) { - $val = '{}' if ref $_->{$k} eq 'HASH'; - $val = '[]' if ref $_->{$k} eq 'ARRAY'; - } - - push @buff, "$key=$val"; - } + push @buff, to_toml($_); } pop @KEYS; -- 2.30.2