mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Let Sketch.getExtensions() return a List
This simplifies upcoming changes.
This commit is contained in:
parent
a6013720e5
commit
af0d8c7f5c
@ -170,7 +170,7 @@ public class Sketch {
|
|||||||
|
|
||||||
code = new SketchCode[list.length];
|
code = new SketchCode[list.length];
|
||||||
|
|
||||||
String[] extensions = getExtensions();
|
List<String> extensions = getExtensions();
|
||||||
|
|
||||||
for (String filename : list) {
|
for (String filename : list) {
|
||||||
// Ignoring the dot prefix files is especially important to avoid files
|
// Ignoring the dot prefix files is especially important to avoid files
|
||||||
@ -1849,11 +1849,7 @@ public class Sketch {
|
|||||||
* extensions.
|
* extensions.
|
||||||
*/
|
*/
|
||||||
public boolean validExtension(String what) {
|
public boolean validExtension(String what) {
|
||||||
String[] ext = getExtensions();
|
return getExtensions().contains(what);
|
||||||
for (int i = 0; i < ext.length; i++) {
|
|
||||||
if (ext[i].equals(what)) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1873,8 +1869,8 @@ public class Sketch {
|
|||||||
/**
|
/**
|
||||||
* Returns a String[] array of proper extensions.
|
* Returns a String[] array of proper extensions.
|
||||||
*/
|
*/
|
||||||
public String[] getExtensions() {
|
public List<String> getExtensions() {
|
||||||
return new String[] { "ino", "pde", "c", "cpp", "h" };
|
return Arrays.asList("ino", "pde", "c", "cpp", "h");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user