Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Jul 16, 2024
1 parent 6849f07 commit 94f2b55
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions posting/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"os"
"sync/atomic"
"time"
"unsafe"

"github.com/golang/glog"
"github.com/pkg/errors"
Expand Down Expand Up @@ -651,33 +650,33 @@ type rebuilder struct {
fn func(uid uint64, pl *List, txn *Txn) ([]*pb.DirectedEdge, error)
}

func decodeUint64MatrixUnsafe(data []byte, matrix *[][]uint64) error {
if len(data) == 0 {
return nil
}

offset := 0
// Read number of rows
rows := *(*uint64)(unsafe.Pointer(&data[offset]))
offset += 8

fmt.Println(rows)
*matrix = make([][]uint64, rows)

for i := 0; i < int(rows); i++ {
// Read row length
rowLen := *(*uint64)(unsafe.Pointer(&data[offset]))
offset += 8

(*matrix)[i] = make([]uint64, rowLen)
for j := 0; j < int(rowLen); j++ {
(*matrix)[i][j] = *(*uint64)(unsafe.Pointer(&data[offset]))
offset += 8
}
}

return nil
}
//func decodeUint64MatrixUnsafe(data []byte, matrix *[][]uint64) error {
// if len(data) == 0 {
// return nil
// }
//
// offset := 0
// // Read number of rows
// rows := *(*uint64)(unsafe.Pointer(&data[offset]))
// offset += 8
//
// fmt.Println(rows)
// *matrix = make([][]uint64, rows)
//
// for i := 0; i < int(rows); i++ {
// // Read row length
// rowLen := *(*uint64)(unsafe.Pointer(&data[offset]))
// offset += 8
//
// (*matrix)[i] = make([]uint64, rowLen)
// for j := 0; j < int(rowLen); j++ {
// (*matrix)[i][j] = *(*uint64)(unsafe.Pointer(&data[offset]))
// offset += 8
// }
// }
//
// return nil
//}

func (r *rebuilder) RunWithoutTemp(ctx context.Context) error {
stream := pstore.NewStreamAt(r.startTs)
Expand Down

0 comments on commit 94f2b55

Please sign in to comment.