Repository navigation
Conversation
The gridRing subcommand sizes its output array with maxGridRingSize (6 * k), but near a pentagon the ring has fewer cells and the library leaves the unused slots as 0. The json branch already skipped those slots; the newline branch printed every slot, so for example `h3 gridRing -c 820807fffffffff -k 1 -f newline` printed the pentagon's 5 neighbours followed by a line containing `0`. The newline branch now skips zero entries, as gridDisk's newline branch does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe ChangesgridRing newline output
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
|
|
|
@Feldt could you sign the CLA so we can merge your change? |
h3 gridRing -f newlineprinted a0line for each unused slot of its output array. The CLI sizes that array withmaxGridRingSize(6 * k), and near a pentagon the ring has fewer cells, so the library leaves the remaining slots as 0 (thegridRingdocs say elements may be left zero). The json branch of the same subcommand already skips zero slots, and so does the newline branch ofgridDisk. The newline branch ofgridRingdid not.On master:
The json output of the same call lists only the 5 neighbours of the pentagon. Hexagons near a pentagon hit this too:
-c 820817fffffffff -k 2 -f newlineprints 11 cells and a0.Changes:
src/apps/filters/h3.c: thegridRingnewline branch skips zero entries, the same checkgridDiskuses.tests/cli/gridRing.txt: newtestCliGridRingPentagonNewline, which counts the newline output lines for a pentagon at k = 1 and expects 5. It fails on master (6 lines) and passes with the fix. It counts lines rather than comparing the cell list, because the fallback ring's cell order comes from thegridDiskinternals, and Reimplement gridDisk internals with BFS #1217 changes that order.CHANGELOG.md: a line under Unreleased / Fixed.Test:
With the fix, the full
ctestrun passes in Debug and Release builds with-DWARNINGS_AS_ERRORS=ONon macOS, andmake formatwith clang-format 14 leaves no diff.I prepared this change with an AI coding agent (Claude Code). I'm responsible for it and will answer review comments.
🤖 Generated with Claude Code