linksplatform / linksplatform/Collections
Fix CharSegment Equals
- Dominant language
- C#
- Stars
- 2
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
[CharSegment](https://github.com/linksplatform/Collections/blob/3643cf14cbf82df06b22df1ec7f9dd0bc5c68f8d/csharp/Platform.Collections/Segments/CharSegment.cs) has bug in [Equals](https://github.com/linksplatform/Collections/blob/3643cf14cbf82df06b22df1ec7f9dd0bc5c68f8d/csharp/Platform.Collections/Segments/CharSegment.cs#L31-L46) method
https://github.com/linksplatform/Collections/blob/3643cf14cbf82df06b22df1ec7f9dd0bc5c68f8d/csharp/Platform.Collections/Segments/CharSegment.cs#L31-L46
Fix it
Small example [use this [sandbox](https://github.com/Konard/LinksPlatform/blob/master/Platform/Platform.Sandbox/AllRepeatingSubstringsInString.cs) and add property `PublicDictionary` to `Walker4`]:
```csharp
/*
public IDictionary PublicDictionary
{
get => Dictionary;
}
*/
var text = "aaaaaaaaaa";
var walker = new Walker4();
walker.WalkAll(text);
foreach (var l in walker.PublicDictionary)
{
foreach (var r in walker.PublicDictionary)
{
Console.WriteLine($"{l} == {r} ==> {l.Key.Equals(r.Key)}");
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with csharp/Platform.Collections/Segments/CharSegment.cs and inspect the Equals method at the linked lines. Use the linked AllRepeatingSubstringsInString.cs sandbox and the proposed Walker4 PublicDictionary example to reproduce the incorrect comparisons. Done means equivalent CharSegment instances compare correctly in that example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100