aboutsummaryrefslogtreecommitdiffstats
path: root/prog/rand.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-06-06 12:51:52 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-06-07 10:41:01 +0200
commit948dd3af445f31e056db6116c09f095933baed5f (patch)
treef0d35359cfcdfe25bb9932bf2f750bc855c3b62f /prog/rand.go
parent3f04838a10346e60b9dd81f0adb47c2518486d28 (diff)
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.
Diffstat (limited to 'prog/rand.go')
-rw-r--r--prog/rand.go10
1 files changed, 2 insertions, 8 deletions
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))})
}
}