Skip to content

Commit 35de7a2

Browse files
authored
Merge pull request kubernetes#84957 from ZP-AlwaysWin/dev-1105-1
Remove unnecessary judgment
2 parents 681d224 + f812530 commit 35de7a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/scheduler/algorithm/predicates/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func FilterPodsByNamespace(pods []*v1.Pod, ns string) []*v1.Pod {
6767

6868
// CreateSelectorFromLabels is used to define a selector that corresponds to the keys in a map.
6969
func CreateSelectorFromLabels(aL map[string]string) labels.Selector {
70-
if aL == nil || len(aL) == 0 {
70+
if len(aL) == 0 {
7171
return labels.Everything()
7272
}
7373
return labels.Set(aL).AsSelector()

staging/src/k8s.io/apimachinery/pkg/util/naming/from_stack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var stackCreator = regexp.MustCompile(`(?m)^created by (.*)\n\s+(.*):(\d+) \+0x[
8282
func extractStackCreator() (string, int, bool) {
8383
stack := debug.Stack()
8484
matches := stackCreator.FindStringSubmatch(string(stack))
85-
if matches == nil || len(matches) != 4 {
85+
if len(matches) != 4 {
8686
return "", 0, false
8787
}
8888
line, err := strconv.Atoi(matches[3])

0 commit comments

Comments
 (0)