Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Addresses review feedback about redundant boundary checking in _check_dig_fits_inside. The condition j < 0 was checked twice: first at line 317, then again in the compound condition at line 321.

Changes:

  • Removed redundant j < 0 from compound condition, keeping only j + self.thick - 1 >= shape[1]
# Before
if j < 0:
    raise DigOutsideShape(...)
if j < 0 or j + self.thick - 1 >= shape[1]:  # j < 0 already checked above
    raise DigOutsideShape(...)

# After
if j < 0:
    raise DigOutsideShape(...)
if j + self.thick - 1 >= shape[1]:
    raise DigOutsideShape(...)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: spiani <8956990+spiani@users.noreply.github.com>
@spiani spiani marked this pull request as ready for review December 2, 2025 17:54
Copilot AI changed the title [WIP] Address feedback on Digs fixes Remove duplicate j < 0 boundary check in dig validation Dec 2, 2025
Copilot AI requested a review from spiani December 2, 2025 17:54
@spiani spiani merged commit 486901b into fixing_digs Dec 2, 2025
@spiani spiani deleted the copilot/sub-pr-64 branch December 2, 2025 17:54
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