Skip to content

Commit

Permalink
Driver Listener List to Set
Browse files Browse the repository at this point in the history
  • Loading branch information
kairoh committed Oct 7, 2023
1 parent 90830ea commit 139ec38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"java.configuration.updateBuildConfiguration": "automatic",
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
],
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
Expand Down Expand Up @@ -58,8 +60,8 @@ public class FsStoryTellerAsyncDriver implements StoryTellerAsyncDriver {
@Setter
private SdPartition sdPartition = null;

private List<DevicePluggedListener> pluggedlisteners = new ArrayList<>();
private List<DeviceUnpluggedListener> unpluggedlisteners = new ArrayList<>();
private Set<DevicePluggedListener> pluggedlisteners = new HashSet<>();
private Set<DeviceUnpluggedListener> unpluggedlisteners = new HashSet<>();

public FsStoryTellerAsyncDriver() {
// Initialize libusb, handle and propagate hotplug events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -66,8 +68,8 @@ public class RawStoryTellerAsyncDriver implements StoryTellerAsyncDriver {
static final int PACK_TRANSFER_CHUNK_SECTOR_SIZE = 5000; // 2.5 MB

private Device device = null;
private List<DevicePluggedListener> pluggedlisteners = new ArrayList<>();
private List<DeviceUnpluggedListener> unpluggedlisteners = new ArrayList<>();
private Set<DevicePluggedListener> pluggedlisteners = new HashSet<>();
private Set<DeviceUnpluggedListener> unpluggedlisteners = new HashSet<>();

@Getter
@Setter
Expand Down

0 comments on commit 139ec38

Please sign in to comment.