Skip to content

Commit 1a02d15

Browse files
authored
Merge pull request #769 from ishitatsuyuki/dedup-hashset
(asbg) Use HashSet for duplication detection
2 parents 0fe07b6 + d9f8932 commit 1a02d15

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)