aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-04-20 15:50:52 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-04-25 07:36:03 +0200
commit3e9855a1768604bcb70da0d76a57b16a54848855 (patch)
tree20992ca2aed2a3b51829d9433e008366ea174dcb /pkg
parent03d97a1bcdd0542ca2240cf468d9be585cfc06b7 (diff)
pkg/compiler: simplify sort predicate
Diffstat (limited to 'pkg')
-rw-r--r--pkg/compiler/gen.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/compiler/gen.go b/pkg/compiler/gen.go
index f357adc24..4b1b05ed1 100644
--- a/pkg/compiler/gen.go
+++ b/pkg/compiler/gen.go
@@ -167,11 +167,11 @@ func (comp *compiler) genStructDescs(syscalls []*prog.Syscall) []*prog.KeyedStru
}
sort.Slice(ctx.structs, func(i, j int) bool {
- si, sj := ctx.structs[i], ctx.structs[j]
- if si.Key.Name != sj.Key.Name {
- return si.Key.Name < sj.Key.Name
+ si, sj := ctx.structs[i].Key, ctx.structs[j].Key
+ if si.Name != sj.Name {
+ return si.Name < sj.Name
}
- return si.Key.Dir < sj.Key.Dir
+ return si.Dir < sj.Dir
})
return ctx.structs
}