-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(#43) moved IsPrefixOf to IPath and added StartsWith to IPath #69
Conversation
Also solved #28 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice idea. I only have a minor complaint.
TruePath/AbsolutePath.cs
Outdated
public bool IsPrefixOf(AbsolutePath other) | ||
{ | ||
if (!(Value.Length <= other.Value.Length && other.Value.StartsWith(Value))) return false; | ||
return other.Value.Length == Value.Length || other.Value[Value.Length] == Path.DirectorySeparatorChar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think other.Value[Value.Length] == Path.DirectorySeparatorChar
is ever true for normalized paths (except for the bare root /
), is it? So maybe let's drop that check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved in 63a457e
e5a97ab
to
2f1f3a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.