ext/h3/src/src/h3lib/lib/h3Index.c in h3-3.6.0 vs ext/h3/src/src/h3lib/lib/h3Index.c in h3-3.6.1
- old
+ new
@@ -264,9 +264,12 @@
* contiguous regions exist in the set at all and no compression possible)
* @return an error code on bad input data
*/
int H3_EXPORT(compact)(const H3Index* h3Set, H3Index* compactedSet,
const int numHexes) {
+ if (numHexes == 0) {
+ return 0;
+ }
int res = H3_GET_RESOLUTION(h3Set[0]);
if (res == 0) {
// No compaction possible, just copy the set to output
for (int i = 0; i < numHexes; i++) {
compactedSet[i] = h3Set[i];