This repository was archived by the owner on Aug 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-22
lines changed Expand file tree Collapse file tree 1 file changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -261,31 +261,16 @@ func (b *SchemaBuilder) buildKindRegistry() {
261
261
// Ensure deterministic order for picks: sort each slice by Group, Version, Kind, SchemaKey
262
262
for kindKey , infos := range b .kindRegistry {
263
263
slices .SortFunc (infos , func (a , b ResourceInfo ) int {
264
- if a .Group != b .Group {
265
- if a .Group < b .Group {
266
- return - 1
267
- }
268
- return 1
264
+ if cmp := strings .Compare (a .Group , b .Group ); cmp != 0 {
265
+ return cmp
269
266
}
270
- if a .Version != b .Version {
271
- if a .Version < b .Version {
272
- return - 1
273
- }
274
- return 1
267
+ if cmp := strings .Compare (a .Version , b .Version ); cmp != 0 {
268
+ return cmp
275
269
}
276
- if a .Kind != b .Kind {
277
- if a .Kind < b .Kind {
278
- return - 1
279
- }
280
- return 1
270
+ if cmp := strings .Compare (a .Kind , b .Kind ); cmp != 0 {
271
+ return cmp
281
272
}
282
- if a .SchemaKey < b .SchemaKey {
283
- return - 1
284
- }
285
- if a .SchemaKey > b .SchemaKey {
286
- return 1
287
- }
288
- return 0
273
+ return strings .Compare (a .SchemaKey , b .SchemaKey )
289
274
})
290
275
b .kindRegistry [kindKey ] = infos
291
276
}
You can’t perform that action at this time.
0 commit comments