Skip to content

Conversation

@danipen
Copy link
Owner

@danipen danipen commented Dec 16, 2025

This pull request adds equality and hash code support to the LineText struct.

Equality and Hash Code Implementation in LineText:

  • Implemented IEquatable<LineText> and added custom Equals(LineText), Equals(object), and GetHashCode() methods to the LineText struct, including optimized checks for reference equality and efficient content comparison. Also added == and != operators. [1] [2]

Unit Tests for Equality and Hash Code:

  • Added a comprehensive set of unit tests in LineTextTests.cs to verify all aspects of equality, hash code generation, and their contract (including tests for empty/default values, different memory regions, Unicode, and collection usage).

@danipen danipen merged commit e25f08a into master Dec 16, 2025
5 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.

2 participants