asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.88k stars 295 forks source link

Code quality - drop while(true) #526

Open Ayowel opened 3 years ago

Ayowel commented 3 years ago

Fix #524 and added comments on the loops where a while(true) seemed legitimate to justify them.

Note that:

Other than that, old and new code should be strictly equivalent

Ayowel commented 3 years ago

Updated the while loop to a for in DirectoryServiceImpl as it is more accurate to what the code does.

Also removed the class' constructor as well as some attributes that were not used. Dropped a lambda instantiation as the raw value it returned could be used instead and avoided the use of a stream to create a list where the list could directly be instantiated instead.