mirror of
https://github.com/dlang/phobos.git
synced 2025-04-26 21:22:20 +03:00
Remove range support from DirIteratorImpl.__ctor
(#10667)
Was unused, untested and potentially broken.
This commit is contained in:
parent
274109b3de
commit
1e70ab9301
1 changed files with 8 additions and 22 deletions
20
std/file.d
20
std/file.d
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue