mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
Merge pull request #4603 from JackStouffer/cache
Enhanced cache and map to provide length info for their slices
This commit is contained in:
commit
cd68d1a582
1 changed files with 4 additions and 4 deletions
|
@ -426,8 +426,8 @@ private struct _Cache(R, bool bidir)
|
||||||
}
|
}
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
import std.range : take;
|
import std.range : takeExactly;
|
||||||
return this[low .. $].take(high - low);
|
return this[low .. $].takeExactly(high - low);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,8 +641,8 @@ private struct MapResult(alias fun, Range)
|
||||||
|
|
||||||
auto opSlice(opSlice_t low, opSlice_t high)
|
auto opSlice(opSlice_t low, opSlice_t high)
|
||||||
{
|
{
|
||||||
import std.range : take;
|
import std.range : takeExactly;
|
||||||
return this[low .. $].take(high - low);
|
return this[low .. $].takeExactly(high - low);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue