Remove range support from DirIteratorImpl.__ctor (#10667)

Was unused, untested and potentially broken.
This commit is contained in:
Elias Batek 2025-03-13 08:56:08 +01:00 committed by GitHub
parent 274109b3de
commit 1e70ab9301
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4797,15 +4797,13 @@ private struct DirIteratorImpl
}
}
this(R)(R pathname, SpanMode mode, bool followSymlink)
if (isSomeFiniteCharInputRange!R)
this(string pathname, SpanMode mode, bool followSymlink)
{
import std.path : absolutePath, isAbsolute;
_mode = mode;
_followSymlink = followSymlink;
static if (isNarrowString!R && is(immutable ElementEncodingType!R == immutable char))
{
import std.path : absolutePath, isAbsolute;
string pathnameStr;
if (pathname.isAbsolute)
pathnameStr = pathname;
@ -4815,18 +4813,6 @@ private struct DirIteratorImpl
const offset = (pathnameStr.length - pathname.length);
_pathPrefix = pathnameStr[0 .. offset];
}
}
else
{
import std.algorithm.searching : count;
import std.array : array;
import std.path : asAbsolutePath;
import std.utf : byChar;
string pathnameStr = pathname.asAbsolutePath.array;
const pathnameCount = pathname.byChar.count;
const offset = (pathnameStr.length - pathnameCount);
_pathPrefix = pathnameStr[0 .. offset];
}
if (stepIn(pathnameStr))
{