From 3e9855a1768604bcb70da0d76a57b16a54848855 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 20 Apr 2020 15:50:52 +0200 Subject: pkg/compiler: simplify sort predicate --- pkg/compiler/gen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg') 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 } -- cgit mrf-deployment