ext/h3/src/src/h3lib/lib/h3Index.c in h3-3.4.0 vs ext/h3/src/src/h3lib/lib/h3Index.c in h3-3.4.4
- old
+ new
@@ -24,11 +24,10 @@
#include <stdlib.h>
#include <string.h>
#include "baseCells.h"
#include "faceijk.h"
#include "mathExtensions.h"
-#include "stackAlloc.h"
/**
* Returns the H3 resolution of an H3 index.
* @param h The H3 index.
* @return The resolution of the H3 index argument.
@@ -386,14 +385,14 @@
*/
int H3_EXPORT(uncompact)(const H3Index* compactedSet, const int numHexes,
H3Index* h3Set, const int maxHexes, const int res) {
int outOffset = 0;
for (int i = 0; i < numHexes; i++) {
+ if (compactedSet[i] == 0) continue;
if (outOffset >= maxHexes) {
// We went too far, abort!
return -1;
}
- if (compactedSet[i] == 0) continue;
int currentRes = H3_GET_RESOLUTION(compactedSet[i]);
if (currentRes > res) {
// Nonsensical. Abort.
return -2;
}