Skip to content

Commit fb06a9c

Browse files
committed
more comments, code clean up
1 parent fae49a6 commit fb06a9c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Geo/Address/Formatter.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ sub format_address {
483483
# 12. clean again
484484
$text = $self->_clean($text);
485485

486-
# 13. set final components
486+
# 13. set final components (so we can get them later)
487487
$self->{final_components} = $rh_components;
488488

489489
# all done
@@ -937,9 +937,9 @@ sub _render_template {
937937
$output = $self->_clean($output);
938938

939939
# is it empty?
940-
# if yes and there is only one component then just use that one
941-
if ($output !~ m/\w/) {
942-
my @comps = sort keys %$components;
940+
if (length($output) == 0){
941+
# if yes and there is only one component then just use that one
942+
my @comps = keys %$components;
943943
if (scalar(@comps) == 1) {
944944
foreach my $k (@comps) {
945945
$output = $components->{$k};

0 commit comments

Comments
 (0)