Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Dec 25, 2024
1 parent 1e35de4 commit 2d82ff3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,8 @@ github.com/dgraph-io/gqlparser/v2 v2.2.2 h1:CnxXOKL4EPguKqcGV/z4u4VoW5izUkOTIsNM
github.com/dgraph-io/gqlparser/v2 v2.2.2/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU=
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15 h1:X2NRsgAtVUAp2nmTPCq+x+wTcRRrj74CEpy7E0Unsl4=
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15/go.mod h1:7z3c/5w0sMYYZF5bHsrh8IH4fKwG5O5Y70cPH1ZLLRQ=
github.com/dgraph-io/ristretto/v2 v2.0.1-0.20241207103255-02acef2e21af h1:oh/6dn0uitvGURnZ8CaRaEiIgvboLJv4N4PjYulkvis=
github.com/dgraph-io/ristretto/v2 v2.0.1-0.20241207103255-02acef2e21af/go.mod h1:K7caLeufSdxm+ITp1n/73U+VbFVAHrexfLbz4n14hpo=
github.com/dgraph-io/ristretto/v2 v2.0.1-0.20241225051636-a881a3ee595b h1:HFfYu0UFFwjUU2q63wTtNtc4vXQbw55m2WVoMcFXhzA=
github.com/dgraph-io/ristretto/v2 v2.0.1-0.20241225051636-a881a3ee595b/go.mod h1:K7caLeufSdxm+ITp1n/73U+VbFVAHrexfLbz4n14hpo=
github.com/dgraph-io/ristretto/v2 v2.0.1 h1:7W0LfEP+USCmtrUjJsk+Jv2jbhJmb72N4yRI7GrLdMI=
github.com/dgraph-io/ristretto/v2 v2.0.1/go.mod h1:K7caLeufSdxm+ITp1n/73U+VbFVAHrexfLbz4n14hpo=
github.com/dgraph-io/simdjson-go v0.3.0 h1:h71LO7vR4LHMPUhuoGN8bqGm1VNfGOlAG8BI6iDUKw0=
github.com/dgraph-io/simdjson-go v0.3.0/go.mod h1:Otpysdjaxj9OGaJusn4pgQV7OFh2bELuHANq0I78uvY=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
Expand Down
12 changes: 0 additions & 12 deletions posting/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,18 +471,6 @@ func NewList(key []byte, plist *pb.PostingList, minTs uint64) *List {
}
}

func (l *List) markDeleted() {
l.Lock()
defer l.Unlock()
l.key = nil
}

func (l *List) isDeleted() bool {
l.RLock()
defer l.RUnlock()
return l.key == nil
}

func (l *List) maxVersion() uint64 {
l.RLock()
defer l.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion posting/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func TestAddMutation_mrjn1(t *testing.T) {
func TestReadSingleValue(t *testing.T) {
defer setMaxListSize(maxListSize)
maxListSize = math.MaxInt32
pstore.DropAll()
require.Equal(t, nil, pstore.DropAll())

// We call pl.Iterate and then stop iterating in the first loop when we are reading
// single values. This test confirms that the two functions, getFirst from this file
Expand Down
2 changes: 1 addition & 1 deletion posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func (sm *MemoryLayer) get(key []byte) (*CachePL, bool) {
if val.list == nil {
return nil, false
}
return val, !val.list.isDeleted()
return val, true
}

func (sm *MemoryLayer) set(key []byte, i *CachePL) {
Expand Down
6 changes: 3 additions & 3 deletions posting/mvcc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ func BenchmarkTestCache(b *testing.B) {

attr := x.GalaxyAttr("cache")
keys := make([][]byte, 0)
N := uint64(10000)
N := 10000
txn := Oracle().RegisterStartTs(1)

for i := uint64(1); i < N; i++ {
for i := uint64(1); i < uint64(N); i++ {

Check failure on line 119 in posting/mvcc_test.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion int -> uint64 (gosec)
key := x.DataKey(attr, i)
keys = append(keys, key)
edge := &pb.DirectedEdge{
Expand All @@ -143,7 +143,7 @@ func BenchmarkTestCache(b *testing.B) {

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
key := keys[rand.Intn(int(N-1))]
key := keys[rand.Intn(N-1)]
_, err = getNew(key, pstore, math.MaxUint64)
if err != nil {
panic(err)
Expand Down

0 comments on commit 2d82ff3

Please sign in to comment.