Speeding up DCD in big projects
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Jul 21 19:03:05 UTC 2020
On Tue, Jul 21, 2020 at 10:32:39AM -0700, H. S. Teoh via Digitalmars-d wrote:
[...]
> Which also begs the question, *why* does it even throw in the first
> place. The non-existence of a file is a normally-expected outcome of
> isFile/isDir, throwing in that case seems excessively heavy-handed.
> It's probably a case of bad API design.
[...]
There is the workaround of writing:
if (f.exists && f.isDir) ...
but it's ugly and involves an extra unnecessary syscall roundtrip.
Basically, this kind of API design is just hideous. I propose we remove
the throw from isDir/isFile.
T
--
Never step over a puddle, always step around it. Chances are that whatever made it is still dripping.
More information about the Digitalmars-d
mailing list