From 4da021feb0cab54d87d5b08c41bc3160132e5bb7 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Thu, 14 May 2020 11:57:49 +0200 Subject: targets.go: append flags in a more readable way As suggested by Dmitry Vyukov Signed-off-by: Alexander Potapenko --- sys/targets/targets.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 548b114f0..1395b13ff 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -477,8 +477,9 @@ func initTarget(target *Target, OS, arch string) { target.CCompiler = fmt.Sprintf("cant-build-%v-on-%v", target.OS, runtime.GOOS) target.CPP = target.CCompiler } - target.CFlags = append(append([]string{}, target.osCommon.cflags...), target.CFlags...) - target.CFlags = append(append([]string{}, commonCFlags...), target.CFlags...) + for _, flags := range [][]string{commonCFlags, target.osCommon.cflags} { + target.CFlags = append(target.CFlags, flags...) + } } func (target *Target) lazyInit() { -- cgit mrf-deployment