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,34 +4797,20 @@ private struct DirIteratorImpl
} }
} }
this(R)(R pathname, SpanMode mode, bool followSymlink) this(string pathname, SpanMode mode, bool followSymlink)
if (isSomeFiniteCharInputRange!R)
{ {
import std.path : absolutePath, isAbsolute;
_mode = mode; _mode = mode;
_followSymlink = followSymlink; _followSymlink = followSymlink;
static if (isNarrowString!R && is(immutable ElementEncodingType!R == immutable char)) string pathnameStr;
{ if (pathname.isAbsolute)
import std.path : absolutePath, isAbsolute; pathnameStr = pathname;
string pathnameStr;
if (pathname.isAbsolute)
pathnameStr = pathname;
else
{
pathnameStr = pathname.absolutePath;
const offset = (pathnameStr.length - pathname.length);
_pathPrefix = pathnameStr[0 .. offset];
}
}
else else
{ {
import std.algorithm.searching : count; pathnameStr = pathname.absolutePath;
import std.array : array; const offset = (pathnameStr.length - pathname.length);
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]; _pathPrefix = pathnameStr[0 .. offset];
} }