linksplatform / linksplatform/Data.Doublets

Confusing code in `.DeleteAll()`

Open
#354 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug C# good first issue
Dominant language
C#
Stars
14
Forks
5
PR merge metrics
No merged PRs in 30d

Description

It can be written easier
https://github.com/linksplatform/Data.Doublets/blob/f7dfc0ef6eac7e68818be1c1eb08caa8b56a85bf/csharp/Platform.Data.Doublets/ILinksExtensions.cs#L170-L179
```csharp
var equalityComparer = EqualityComparer.Default;
var comparer = Comparer.Default;
for (var i = links.Count(); comparer.Compare(i, default) > 0; i = links.Count())
{
links.Delete(i);
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in csharp/Platform.Data.Doublets/ILinksExtensions.cs at lines 170-179 and inspect the .DeleteAll() implementation. Review whether the equality comparer, comparer, and loop condition are necessary, then simplify the code while preserving its deletion behavior. The issue does not mention a specific test; verify the existing behavior before and after the refactor.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.