-
Notifications
You must be signed in to change notification settings - Fork 761
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
StringSegment GetHashCode() includes the Offset but Equals doesn't care about it #137
Comments
Yup, seems like a bug. It should probably add individual chars to the |
I think if you just delete these two lines from
But yes, if you can do it without an allocation that might be better. |
Wouldn't that still be problematic if the two strings are different but the |
So either you add |
Huh. I thought it was adding the |
Interestingly |
Surely
GetHashCode()
should not rely on theOffset
since inEquals
, twoStringSegments
are equal if they have equal values regardless as to where they are located in the string.The text was updated successfully, but these errors were encountered: