Skip to content

Commit

Permalink
golangci-lint wsl
Browse files Browse the repository at this point in the history
  • Loading branch information
zachcoleman committed Aug 11, 2024
1 parent 1bf2e6e commit 3664784
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions h3.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,27 +257,33 @@ func CellsToMultiPolygon(cells []Cell) []GeoPolygon {
h3Indexes := cellsToC(cells)
cLinkedGeoPolygon := new(C.LinkedGeoPolygon)
C.cellsToLinkedMultiPolygon(&h3Indexes[0], C.int(len(h3Indexes)), cLinkedGeoPolygon)

// traverse polygons and build GeoPolygon set
ret := []GeoPolygon{}

// traverse polygons for linked list of polygons
currPoly := cLinkedGeoPolygon
for currPoly != nil {
loops := []GeoLoop{}
// traverse the loops for polygon

// traverse loops for a polygon
currLoop := currPoly.first
for currLoop != nil {
loop := []LatLng{}

// traverse points for a loop
currPt := currLoop.first
for currPt != nil {
loop = append(loop, latLngFromC(currPt.vertex))
currPt = currPt.next
}

loops = append(loops, loop)
currLoop = currLoop.next
}

ret = append(ret, GeoPolygon{GeoLoop: loops[0], Holes: loops[1:]})
currPoly = currPoly.next
}

return ret
}

Expand Down

0 comments on commit 3664784

Please sign in to comment.