Skip to content

Commit 0a3c716

Browse files
committed
3: make ci happy
Signed-off-by: TONG, Zhigao <[email protected]>
1 parent 7e0f147 commit 0a3c716

9 files changed

Lines changed: 28 additions & 31 deletions

File tree

pkg/executor/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ go_test(
505505
"//pkg/util/topsql/state",
506506
"@com_github_docker_go_units//:go-units",
507507
"@com_github_gorilla_mux//:mux",
508-
"@com_github_hashicorp_go_version//:go-version",
509508
"@com_github_pingcap_errors//:errors",
510509
"@com_github_pingcap_failpoint//:failpoint",
511510
"@com_github_pingcap_fn//:fn",

pkg/executor/aggregate/agg_hash_partial_worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ func (w *HashAggPartialWorker) getPartialResultsOfEachRow(groupKey [][]byte, fin
244244
delta := mapper[finalWorkerIdx].Set(string(groupKey[i]), w.partialResultsBuffer[lastIdx])
245245
allMemDelta += int64(len(groupKey[i]))
246246
if delta > 0 {
247-
w.partialResultsMapMem.Add(int64(delta))
248-
w.memTracker.Consume(int64(delta))
247+
w.partialResultsMapMem.Add(delta)
248+
w.memTracker.Consume(delta)
249249
}
250250
}
251251
w.partialResultsMapMem.Add(allMemDelta)

pkg/executor/join/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ go_test(
118118
"//pkg/util/chunk",
119119
"//pkg/util/codec",
120120
"//pkg/util/disk",
121-
"//pkg/util/hack",
122121
"//pkg/util/memory",
123122
"//pkg/util/mock",
124123
"//pkg/util/sqlkiller",

pkg/executor/table_reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (e *TableReaderExecutor) setDummy() {
206206
}
207207

208208
func (e *TableReaderExecutor) memUsage() int64 {
209-
const sizeofTableReaderExecutor = int64(unsafe.Sizeof(TableReaderExecutor{}))
209+
const sizeofTableReaderExecutor = int64(unsafe.Sizeof(*e))
210210

211211
res := sizeofTableReaderExecutor
212212
res += size.SizeOfPointer * int64(cap(e.ranges))

pkg/kv/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ go_library(
4040
"//pkg/util/logutil",
4141
"//pkg/util/memory",
4242
"//pkg/util/resourcegrouptag",
43-
"//pkg/util/set",
4443
"//pkg/util/size",
4544
"//pkg/util/tiflash",
4645
"//pkg/util/tiflashcompute",

pkg/kv/key.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -620,17 +620,17 @@ func (m *MemAwareHandleMap[V]) Get(h Handle) (v V, found bool) {
620620
if ph, ok := h.(PartitionHandle); ok {
621621
idx := ph.PartitionID
622622
if h.IsInt() {
623-
if p := m.partitionInts[idx]; p == nil {
623+
p := m.partitionInts[idx]
624+
if p == nil {
624625
return
625-
} else {
626-
ints = p.M
627626
}
627+
ints = p.M
628628
} else {
629-
if p := m.partitionStrs[idx]; p == nil {
629+
p := m.partitionStrs[idx]
630+
if p == nil {
630631
return
631-
} else {
632-
strs = p.M
633632
}
633+
strs = p.M
634634
}
635635
}
636636
if h.IsInt() {

pkg/util/hack/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go_library(
44
name = "hack",
55
srcs = [
66
"hack.go",
7-
"map_abi.go"
7+
"map_abi.go",
88
],
99
importpath = "github.com/pingcap/tidb/pkg/util/hack",
1010
visibility = ["//visibility:public"],
@@ -16,7 +16,7 @@ go_test(
1616
srcs = [
1717
"hack_test.go",
1818
"main_test.go",
19-
"map_abi_test.go"
19+
"map_abi_test.go",
2020
],
2121
embed = [":hack"],
2222
flaky = True,

pkg/util/hack/map_abi.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,21 @@ func (g *groupsReference) group(typ *swissMapType, i uint64) groupReference {
219219
}
220220
}
221221

222-
type TFlag uint8
223-
type Kind uint8
224-
type NameOff int32
225-
type TypeOff int32
226-
type TextOff int32
222+
type abiTFlag uint8
223+
type abiKind uint8
224+
type abiNameOff int32
225+
type abiTypeOff int32
226+
type abiTextOff int32
227227

228228
// src/internal/abi/type.go:Type
229229
type abiType struct {
230230
Size_ uintptr
231-
PtrBytes uintptr // number of (prefix) bytes in the type that can contain pointers
232-
Hash uint32 // hash of type; avoids computation in hash tables
233-
TFlag TFlag // extra type information flags
234-
Align_ uint8 // alignment of variable with this type
235-
FieldAlign_ uint8 // alignment of struct field with this type
236-
Kind_ Kind // enumeration for C
231+
PtrBytes uintptr // number of (prefix) bytes in the type that can contain pointers
232+
Hash uint32 // hash of type; avoids computation in hash tables
233+
TFlag abiTFlag // extra type information flags
234+
Align_ uint8 // alignment of variable with this type
235+
FieldAlign_ uint8 // alignment of struct field with this type
236+
Kind_ abiKind // enumeration for C
237237
// function for comparing objects of this type
238238
// (ptr to object A, ptr to object B) -> ==?
239239
Equal func(unsafe.Pointer, unsafe.Pointer) bool
@@ -249,8 +249,8 @@ type abiType struct {
249249
// including when TFlagGCMaskOnDemand is set. The types will, of course,
250250
// have the same pointer layout (but not necessarily the same size).
251251
GCData *byte
252-
Str NameOff // string form
253-
PtrToThis TypeOff // type for pointer to this type, may be zero
252+
Str abiNameOff // string form
253+
PtrToThis abiTypeOff // type for pointer to this type, may be zero
254254
}
255255

256256
// src/internal/abi/map_swiss.go:SwissMapType
@@ -285,6 +285,7 @@ const (
285285
)
286286

287287
func (g *groupReference) cap(typ *swissMapType) uint64 {
288+
_ = g
288289
return groupCap(uint64(typ.GroupSize), uint64(typ.SlotSize))
289290
}
290291

pkg/util/hack/map_abi_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@ func TestSwissTable(t *testing.T) {
4242
for i := range table.groups.lengthMask + 1 {
4343
ref := table.groups.group(sm.Type, i)
4444
require.True(t, (sm.Type.GroupSize-groupSlotsOffset)%sm.Type.SlotSize == 0)
45-
cap := ref.cap(sm.Type)
46-
require.True(t, cap == swissMapGroupSlots)
47-
for j := range cap {
45+
capacity := ref.cap(sm.Type)
46+
require.True(t, capacity == swissMapGroupSlots)
47+
for j := range capacity {
4848
k, v := *(*uint64)(ref.key(sm.Type, uintptr(j))), *(*uint64)(ref.elem(sm.Type, uintptr(j)))
4949
if k == 1234 && v == 5678 {
5050
require.False(t, found)
5151
found = true
5252
break
5353
}
5454
}
55-
5655
}
5756
}
5857
require.True(t, found)

0 commit comments

Comments
 (0)