Skip to content

Commit

Permalink
Only get nextlocation when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 12, 2024
1 parent f6f2565 commit f4d21a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -13368,9 +13368,10 @@ sub get_all_residences
my $nextnextplace = place({ person => $person, record => $nextnext, nopreposition => 1 });
if(defined($nextnextplace) && ($nextnextplace eq $place) && ($nextplace ne $place)) {
my @locations = get_location($place);
my @nextlocations = get_location($nextplace);

if(my $location = shift @locations) {
my @nextlocations = get_location($nextplace);

if((ref($location) eq 'Geo::Location::Point') && (my $nextlocation = shift @nextlocations)) {
if(ref($nextlocation) eq 'Geo::Location::Point') {
if($location->distance($nextlocation)->mile() >= 30.0) {
Expand Down

0 comments on commit f4d21a0

Please sign in to comment.