Skip to content
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

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

babaruh
Copy link

@babaruh babaruh commented Jun 19, 2024

No description provided.

@babaruh
Copy link
Author

babaruh commented Jun 19, 2024

Also solved #28

Copy link
Owner

@ForNeVeR ForNeVeR left a 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.

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;
Copy link
Owner

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved in 63a457e

@ForNeVeR ForNeVeR self-assigned this Jun 20, 2024
@ForNeVeR ForNeVeR self-requested a review June 20, 2024 09:35
Copy link
Owner

@ForNeVeR ForNeVeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ForNeVeR ForNeVeR merged commit 1d91a5d into ForNeVeR:main Jun 20, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants