Skip to content

Commit d9f8932

Browse files
committed
Use HashSet for duplication detection
1 parent f7a8222 commit d9f8932

File tree

1 file changed

+2
-3
lines changed
  • android-static-binding-generator/project/staticbindinggenerator/src/main/java/org/nativescript/staticbindinggenerator

1 file changed

+2
-3
lines changed

android-static-binding-generator/project/staticbindinggenerator/src/main/java/org/nativescript/staticbindinggenerator/Generator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ public Generator(String outputDir, String[] libs, boolean throwOnError) throws I
4848

4949
public void writeBindings(String filename) throws IOException, ClassNotFoundException {
5050
Binding[] bindings = generateBindings(filename);
51-
List<File> writenFiles = new ArrayList<File>();
51+
Set<File> writtenFiles = new HashSet<File>();
5252
for (Binding b : bindings) {
53-
if (!writenFiles.contains(b.getFile())) {
54-
writenFiles.add(b.getFile());
53+
if (writtenFiles.add(b.getFile())) {
5554
try (PrintStream ps = new PrintStream(b.getFile())) {
5655
ps.append(b.getContent());
5756
}

0 commit comments

Comments
 (0)