Skip to content

Make SemVer Parse sections code easier to read - #7501

Merged
Nigusu-Allehu merged 1 commit into
devfrom
dev-nyenework-readbale-smver-parsesection
Jun 24, 2026
Merged

Nigusu-Allehu merged 1 commit into
devfrom
dev-nyenework-readbale-smver-parsesection

Conversation

@Nigusu-Allehu

@Nigusu-Allehu Nigusu-Allehu commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes:

Description

Reading this code, I found it confusing why we would set dashPos variable both when we find a plus and a dash. I think VersionEndPos better describes what it does. It is the index of where the version part of the semver ends.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@Nigusu-Allehu
Nigusu-Allehu requested a review from a team as a code owner June 23, 2026 15:39
@Nigusu-Allehu Nigusu-Allehu self-assigned this Jun 23, 2026
if (end || value[i] == '+')
{
var start = dashPos + 1;
var start = versionEndPos + 1;

@jebriede jebriede Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Would versionTerminatorPos be more accurate since it captures that the index points at the character that terminates the version section (the -, the +, or the final char), without implying anything about inclusive vs exclusive boundaries? Consider this optional.

@Nigusu-Allehu
Nigusu-Allehu merged commit 9ce79e9 into dev Jun 24, 2026
20 of 21 checks passed
@Nigusu-Allehu
Nigusu-Allehu deleted the dev-nyenework-readbale-smver-parsesection branch June 24, 2026 14:42
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