Skip to content

Conversation

@cartermp
Copy link
Contributor

@cartermp cartermp commented Dec 21, 2018

Replaces equality comparisons with ranges via = and <> to use a new function, Range.equals. This function is the same as the overridden Equals member. The reason is because = and <> on ranges actually end up boxing every range.

@cartermp

This comment has been minimized.

@cartermp cartermp changed the title Range equality Avoid boxing in Range equality comparisons Dec 21, 2018
@TIHan TIHan merged commit 66b20f9 into dotnet:dev16.0 Dec 22, 2018
@TIHan
Copy link
Contributor

TIHan commented Dec 22, 2018

This is great

/// This view hides the use of file indexes and just uses filenames
val mkRange : string -> pos -> pos -> range

val equals : range -> range -> bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you consider putting NoEquality and NoComparison on the range struct?

Also another option is to use open NonStructuralComparison more commonly, which at least flushes out places where structural comparison and equality are being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've considered doing it, just haven't gotten around to it yet :)

Seems like a fine thing to do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is actually fairly icky work, but I have a branch that I'll throw up in PR at some point

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.

3 participants