mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-22 13:19:48 +01:00
Optimized forceRefresh() method by removing redundant boolean paramater
This commit is contained in:
parent
3ccb2d97e1
commit
80fb9a0b38
@ -76,10 +76,6 @@ public class SerialDiscovery implements Discovery, Runnable {
|
||||
serialBoardPorts.addAll(newSerialBoardPorts);
|
||||
}
|
||||
|
||||
public void forceRefresh() {
|
||||
retriggerDiscovery(false);
|
||||
}
|
||||
|
||||
public void setUploadInProgress(boolean param) {
|
||||
uploadInProgress = param;
|
||||
}
|
||||
@ -99,9 +95,9 @@ public class SerialDiscovery implements Discovery, Runnable {
|
||||
serialBoardsListerTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (BaseNoGui.packages != null) {
|
||||
retriggerDiscovery(true);
|
||||
}
|
||||
if (BaseNoGui.packages != null && !pausePolling) {
|
||||
forceRefresh();
|
||||
}
|
||||
}
|
||||
}, 0, 1000);
|
||||
}
|
||||
@ -111,16 +107,12 @@ public class SerialDiscovery implements Discovery, Runnable {
|
||||
serialBoardsListerTimer.cancel();
|
||||
}
|
||||
|
||||
public synchronized void retriggerDiscovery(boolean polled) {
|
||||
public synchronized void forceRefresh() {
|
||||
Platform platform = BaseNoGui.getPlatform();
|
||||
if (platform == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (polled && pausePolling) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> ports = platform.listSerials();
|
||||
if (ports.equals(oldPorts)) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user