Skip to content

Commit dbc115e

Browse files
committed
lint: codeql: fix various
1 parent 0965232 commit dbc115e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

strconv/phonenumber/phonenumberletters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func LetterToNumberMap() map[string]int {
1515
l2n := map[string]int{}
1616

1717
for _, m2 := range m {
18-
if len(m2) > 0 {
18+
if len(m2) >= 3 {
1919
num, err := strconv.Atoi(m2[1])
2020
if err != nil {
2121
panic(err)

type/slicesutil/slice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ func MatrixGetOneOrDefault[C comparable](m [][]C, keyIdx int, keyValue C, wantId
311311
continue
312312
}
313313
if keyValue == row[keyIdx] {
314-
if wantIdx > len(row) {
314+
if wantIdx >= len(row) {
315315
continue
316316
}
317317
return row[wantIdx]

0 commit comments

Comments
 (0)