We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21ca5eb commit 2687f9bCopy full SHA for 2687f9b
h3.go
@@ -1392,16 +1392,14 @@ func vertexesFromC(chs []C.H3Index) []Vertex {
1392
}
1393
1394
func edgesFromC(chs []C.H3Index) []DirectedEdge {
1395
- out := make([]DirectedEdge, 0, len(chs))
1396
-
1397
- for i := range chs {
1398
- if chs[i] <= 0 {
+ in := unsafe.Slice((*DirectedEdge)(unsafe.Pointer(&chs[0])), len(chs))
+ out := in[:0]
+ for i := range in {
+ if in[i] <= 0 {
1399
continue
1400
1401
1402
- out = append(out, DirectedEdge(chs[i]))
+ out = append(out, in[i])
1403
1404
1405
return out
1406
1407
0 commit comments