Merge pull request #165 from vibe-d/pure_parent_path
Make GenericPath.parentPath pure.
This commit is contained in:
commit
a2f970b7b2
|
@ -478,7 +478,7 @@ struct GenericPath(F) {
|
||||||
GenericPath parentPath()
|
GenericPath parentPath()
|
||||||
const @nogc {
|
const @nogc {
|
||||||
auto b = Format.getBackNode(m_path);
|
auto b = Format.getBackNode(m_path);
|
||||||
static const Exception e = new Exception("Path has no parent path");
|
static immutable Exception e = new Exception("Path has no parent path");
|
||||||
if (b.length >= m_path.length) throw e;
|
if (b.length >= m_path.length) throw e;
|
||||||
return GenericPath.fromTrustedString(m_path[0 .. $ - b.length]);
|
return GenericPath.fromTrustedString(m_path[0 .. $ - b.length]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue