Skip to content

fix: handle compacting base cell children#679

Merged
isaacbrodsky merged 6 commits into
uber:masterfrom
jogly:gilley/test-compact-to-res0
Sep 9, 2022
Merged

fix: handle compacting base cell children#679
isaacbrodsky merged 6 commits into
uber:masterfrom
jogly:gilley/test-compact-to-res0

Conversation

@jogly
Copy link
Copy Markdown
Contributor

@jogly jogly commented Sep 8, 2022

Children of a res 0 cell should compact back to that cell successfully.

Comment thread src/apps/testapps/testCompactCells.c Outdated
@isaacbrodsky
Copy link
Copy Markdown
Collaborator

It looks like around h3Index.c line 344 it tries to take the parent of a res 0 cell at res -1 (res -1 was calculated on line 325), which is where the failure is coming from.

@jogly
Copy link
Copy Markdown
Contributor Author

jogly commented Sep 8, 2022

I'm uncertain of this solution, but it passes existing tests and the new failing test.

Basically if the compaction process reaches a base cell, we skip the parent reserved-bit-hit processing and move on to the rest of the logic.

@coveralls
Copy link
Copy Markdown

coveralls commented Sep 8, 2022

Coverage Status

Coverage increased (+0.001%) to 99.035% when pulling f125f68 on jogly:gilley/test-compact-to-res0 into e5209fc on uber:master.

@jogly jogly changed the title test: add test case for compacting res0 children fix: handle compacting base cell children Sep 8, 2022
Comment thread src/h3lib/lib/h3Index.c Outdated
Comment thread src/h3lib/lib/h3Index.c
Comment thread src/apps/testapps/testCompactCells.c
Comment thread src/h3lib/lib/h3Index.c
@isaacbrodsky isaacbrodsky merged commit fb7bb47 into uber:master Sep 9, 2022
@jogly jogly deleted the gilley/test-compact-to-res0 branch September 9, 2022 21:43
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.

4 participants