Skip to content

Commit

Permalink
Simplify the code
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 19, 2024
1 parent 8c26ff2 commit 6a7717b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/Geo/Coder/Free/Display/query.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ sub html {
} elsif(my $scantext = $params{'scantext'}) {
my @rc = $geocoder->geocode(scantext => $scantext);

return '{}' if(scalar(@rc) == 0);

# foreach my $l(@rc) {
# delete $l->{'md5'};
# delete $l->{'sequence'};
# foreach my $key(keys %{$l}) {
# if(!defined($l->{$key})) {
# delete $l->{$key};
if(scalar(@rc) > 0) {
# foreach my $l(@rc) {
# delete $l->{'md5'};
# delete $l->{'sequence'};
# foreach my $key(keys %{$l}) {
# if(!defined($l->{$key})) {
# delete $l->{$key};
# }
# }
# }
# }
# return encode_json \@rc;

my @locations;
foreach my $l(@rc) {
push @locations, {
'latitude' => $l->lat(),
'longitude' => $l->long()
# return encode_json \@rc;

my @locations;
foreach my $l(@rc) {
push @locations, {
'latitude' => $l->lat(),
'longitude' => $l->long()
};
};
};
return encode_json \@locations;
return encode_json \@locations;
}
}

return '{}';
Expand Down

0 comments on commit 6a7717b

Please sign in to comment.