Skip to content

Commit 18db2fa

Browse files
committed
Synthesiser - future set now preallocates memory.
1 parent 05a6074 commit 18db2fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/com/darkprograms/speech/synthesiser/Synthesiser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public InputStream getMP3Data(List<String> synthText) throws IOException{
139139
//Uses an executor service pool for concurrency
140140
ExecutorService pool = Executors.newFixedThreadPool(synthText.size());
141141
//Stores the Future (Data that will be returned in the future)
142-
Set<Future<InputStream>> set = new LinkedHashSet<Future<InputStream>>();
142+
Set<Future<InputStream>> set = new LinkedHashSet<Future<InputStream>>(synthText.size());
143143
for(String part: synthText){ //Iterates through the list
144144
Callable<InputStream> callable = new MP3DataFetcher(part);//Creates Callable
145145
Future<InputStream> future = pool.submit(callable);//Begins to run Callable

0 commit comments

Comments
 (0)