From 0174c6c8f78a3fdd002a73a5fdf559c1b0ec8c34 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 31 Mar 2018 18:55:59 +0200 Subject: prog: reduce nesting level in shrinkExpand --- prog/hints.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/prog/hints.go b/prog/hints.go index 69ba6c6ae..65cd36c18 100644 --- a/prog/hints.go +++ b/prog/hints.go @@ -169,13 +169,12 @@ func checkDataArg(arg *DataArg, compMap CompMap, exec func()) { func shrinkExpand(v uint64, compMap CompMap) (replacers uint64Set) { var prev uint64 for _, isize := range []int{64, 32, 16, 8, -32, -16, -8} { - var mutant uint64 - var size uint + var size, mutant uint64 if isize > 0 { - size = uint(isize) + size = uint64(isize) mutant = v & ((1 << size) - 1) } else { - size = uint(-isize) + size = uint64(-isize) mutant = v | ^((1 << size) - 1) } if size != 64 && prev == mutant { @@ -184,19 +183,21 @@ func shrinkExpand(v uint64, compMap CompMap) (replacers uint64Set) { prev = mutant for newV := range compMap[mutant] { mask := uint64(1<