Skip to content

Commit

Permalink
UploadFactory: removed duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Fissore committed Jun 1, 2015
1 parent 0b8e792 commit 740a14e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions arduino-core/src/processing/app/debug/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,12 @@ static public Uploader getUploaderByPreferences(boolean noUploadPort) {
TargetPlatform target = BaseNoGui.getTargetPlatform();
String board = PreferencesData.get("board");

if (noUploadPort)
{
return new UploaderFactory().newUploader(target.getBoards().get(board), null, noUploadPort);
}
else
{
BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
return new UploaderFactory().newUploader(target.getBoards().get(board), boardPort, noUploadPort);
BoardPort boardPort = null;
if (!noUploadPort) {
boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
}

return new UploaderFactory().newUploader(target.getBoards().get(board), boardPort, noUploadPort);
}

static public boolean upload(SketchData data, Uploader uploader, String buildPath, String suggestedClassName, boolean usingProgrammer, boolean noUploadPort, List<String> warningsAccumulator) throws Exception {
Expand Down

0 comments on commit 740a14e

Please sign in to comment.