From 948dd3af445f31e056db6116c09f095933baed5f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 6 Jun 2020 12:51:52 +0200 Subject: prog: remove target.StringDictionary The linux string dictionary comes from extremely old times when we did not have proper descriptions for almost anything, and the dictionary was a quick hack to guess at least some special strings. Now we have way better descriptions and the dictionary become both unnecessary and probably even harmful. --- prog/rand.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'prog/rand.go') diff --git a/prog/rand.go b/prog/rand.go index 3112fc50a..7a035c1b2 100644 --- a/prog/rand.go +++ b/prog/rand.go @@ -323,15 +323,9 @@ func (r *randGen) randString(s *state, t *BufferType) []byte { '/', ':', '.', ',', '-', '\'', '[', ']', '{', '}'} buf := new(bytes.Buffer) for r.nOutOf(3, 4) { - switch { - case r.nOutOf(10, 21): - dict := r.target.StringDictionary - if len(dict) != 0 { - buf.WriteString(dict[r.Intn(len(dict))]) - } - case r.nOutOf(10, 11): + if r.nOutOf(10, 11) { buf.Write([]byte{punct[r.Intn(len(punct))]}) - default: + } else { buf.Write([]byte{byte(r.Intn(256))}) } } -- cgit mrf-deployment