Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
20b4fa6f
Commit
20b4fa6f
authored
Dec 16, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18494 from brendandburns/perf3
Auto commit by PR queue bot
parents
6adf2278
beda3fd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
selector.go
pkg/labels/selector.go
+6
-6
No files found.
pkg/labels/selector.go
View file @
20b4fa6f
...
@@ -234,8 +234,8 @@ func (r *Requirement) String() string {
...
@@ -234,8 +234,8 @@ func (r *Requirement) String() string {
// Add adds requirements to the selector. It copies the current selector returning a new one
// Add adds requirements to the selector. It copies the current selector returning a new one
func
(
lsel
internalSelector
)
Add
(
reqs
...
Requirement
)
Selector
{
func
(
lsel
internalSelector
)
Add
(
reqs
...
Requirement
)
Selector
{
var
sel
internalSelector
var
sel
internalSelector
for
_
,
item
:=
range
lsel
{
for
ix
:=
range
lsel
{
sel
=
append
(
sel
,
item
)
sel
=
append
(
sel
,
lsel
[
ix
]
)
}
}
for
_
,
r
:=
range
reqs
{
for
_
,
r
:=
range
reqs
{
sel
=
append
(
sel
,
r
)
sel
=
append
(
sel
,
r
)
...
@@ -248,8 +248,8 @@ func (lsel internalSelector) Add(reqs ...Requirement) Selector {
...
@@ -248,8 +248,8 @@ func (lsel internalSelector) Add(reqs ...Requirement) Selector {
// its Requirements match the input Labels. If any
// its Requirements match the input Labels. If any
// Requirement does not match, false is returned.
// Requirement does not match, false is returned.
func
(
lsel
internalSelector
)
Matches
(
l
Labels
)
bool
{
func
(
lsel
internalSelector
)
Matches
(
l
Labels
)
bool
{
for
_
,
req
:=
range
lsel
{
for
ix
:=
range
lsel
{
if
matches
:=
req
.
Matches
(
l
);
!
matches
{
if
matches
:=
lsel
[
ix
]
.
Matches
(
l
);
!
matches
{
return
false
return
false
}
}
}
}
...
@@ -260,8 +260,8 @@ func (lsel internalSelector) Matches(l Labels) bool {
...
@@ -260,8 +260,8 @@ func (lsel internalSelector) Matches(l Labels) bool {
// the internalSelector Requirements' human-readable strings.
// the internalSelector Requirements' human-readable strings.
func
(
lsel
internalSelector
)
String
()
string
{
func
(
lsel
internalSelector
)
String
()
string
{
var
reqs
[]
string
var
reqs
[]
string
for
_
,
req
:=
range
lsel
{
for
ix
:=
range
lsel
{
reqs
=
append
(
reqs
,
req
.
String
())
reqs
=
append
(
reqs
,
lsel
[
ix
]
.
String
())
}
}
return
strings
.
Join
(
reqs
,
","
)
return
strings
.
Join
(
reqs
,
","
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment