Skip to content

IndexEntry: enhance! Also, R# is fun. #336

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

Closed
wants to merge 9 commits into from
Closed

Conversation

dahlbyk
Copy link
Member

@dahlbyk dahlbyk commented Feb 14, 2013

  1. Eliminate one-off IComparer<T> by implementing IComparable<T> on IndexEntry.
  2. Micro-optimization: if we know how big a List<T> will be, we might as well use it.
  3. With conflicts, IndexEntry.StageLevel is useful in DebuggerDisplay.

I also picked a few R# suggestions to clear out project-wide...things we're mostly consistently on. Take them or leave them.

@nulltoken
Copy link
Member

  • Micro-optimization: if we know how big a List<T> will be, we might as well use it.
  • With conflicts, IndexEntry.StageLevel is useful in DebuggerDisplay.
  • I also picked a few R# suggestions to clear out project-wide...things we're mostly consistently on. Take them or leave them.

I took them all!

Eliminate one-off IComparer by implementing IComparable on IndexEntry.

I didn't picked this one though. I fear than implementing a default comparer that only relies on paths may be misleading.

Beside this, I know that comparing paths through an ordinal comparison is going to bite us back (#214), sooner or later and that we'll have be able to "inject" a kind of comparison.

❤️

@nulltoken nulltoken closed this Feb 14, 2013
@nulltoken
Copy link
Member

Merged.

@dahlbyk
Copy link
Member Author

dahlbyk commented Feb 14, 2013

I didn't picked this one though. I fear than implementing a default comparer that only relies on paths may be misleading.

I guess in my head it's reasonable to provide a sensible default for something that often occurs in sequence form. And now that I think about it, maybe there should be a secondary sort on the StageLevel?

Regardless, the core.ignorecase concern is a valid one. Maybe it would be wise to encapsulate path sorting (either internal or public) as Repository.PathComparer, which for now would just return StringComparer.Ordinal but in the future could depend on config?

@dahlbyk dahlbyk deleted the stuff branch February 14, 2013 16:21
@nulltoken
Copy link
Member

Regardless, the core.ignorecase concern is a valid one. Maybe it would be wise to encapsulate path sorting (either internal or public) as Repository.PathComparer, which for now would just return StringComparer.Ordinal but in the future could depend on config?

👍

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.

2 participants