Skip to content

Commit

Permalink
Avoid storing sequential multiselect duplicates
Browse files Browse the repository at this point in the history
The system double triggers for some reason
that needs to be looked into.

Updates #600
  • Loading branch information
shawnlaffan committed Sep 9, 2016
1 parent 11a7395 commit a25ec51
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/Biodiverse/GUI/Dendrogram.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1023,18 +1023,14 @@ sub store_sequential_colour {
$pair->[1] = $pair->[1]->to_string;
}

## we get double triggers for some reason due to a
## Don't store sequential duplicates.
## We get double triggers for some reason due to a
## higher sub being called twice for each colour event
#if (!scalar @$store) {
# push @$store, $pair;
# next PAIR;
#}
#
# clear pre-existing (assumes we don't insert dups from other code locations)
#my $idx = firstidx {$_->[0] eq $pair->[0]} @$store;
#if ($idx != -1) {
# splice @$store, $idx, 1;
#}
next PAIR
if scalar @$store
&& $store->[-1][0] eq $pair->[0]
&& ($store->[-1][1] // '') eq ($pair->[1] // '');

push @$store, $pair;
}

Expand Down

0 comments on commit a25ec51

Please sign in to comment.