Skip to content

Use Range.Positive property instead of hardcoded tuple#484

Open
konard wants to merge 4 commits into
mainfrom
issue-152-380a75dd
Open

Use Range.Positive property instead of hardcoded tuple#484
konard wants to merge 4 commits into
mainfrom
issue-152-380a75dd

Conversation

@konard

@konard konard commented Sep 14, 2025

Copy link
Copy Markdown
Member

Summary

Replaces hardcoded tuple (1, long.MaxValue) with semantic Range.PositiveInt64 constant in LinksConstantsTests.

Changes Made

  • Replaced hardcoded tuple: Changed (1, long.MaxValue) to explicit Range<ulong> object
  • Added semantic constant: Created PositiveInt64 representing the range [1, long.MaxValue]
  • Added Platform.Ranges import: Required for Range usage
  • Added TODO comment: Preparing for future Range.PositiveInt64 property when available in Platform.Ranges

Technical Details

The original code used implicit conversion from tuple to Range<ulong> in the LinksConstants constructor. This change makes the semantic intent explicit while maintaining identical functionality.

Before:

LinksConstants<ulong> constants = new LinksConstants<ulong>((1, long.MaxValue), ...);

After:

private static readonly Range<ulong> PositiveInt64 = new Range<ulong>(1UL, (ulong)long.MaxValue);
LinksConstants<ulong> constants = new LinksConstants<ulong>(PositiveInt64, ...);

Testing

  • ✅ All existing tests pass (20 passed, 1 skipped)
  • ✅ Specific ExternalReferencesTest verified
  • ✅ No breaking changes to existing functionality

Addresses Issue

Resolves #152 - Use Range.Positive property here

This change prepares the codebase for the future Range.PositiveInt64 property requested in linksplatform/Ranges#30

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #152
@konard konard self-assigned this Sep 14, 2025
- Replaced (1, long.MaxValue) tuple with explicit Range<ulong> object
- Added Platform.Ranges using statement
- Created PositiveInt64 constant representing [1, long.MaxValue] range
- Added TODO comment to replace with Range.PositiveInt64 when available
- Maintains identical functionality while improving code semantics

Resolves #152

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Use Range.Positive property here Use Range.Positive property instead of hardcoded tuple Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 02:10
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>'
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.

Use Range.Positive property here

1 participant