From 1da82ae0f070bbed7300a8e9462abeeb0cf3c344 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 1 Aug 2018 19:45:15 +0200 Subject: prog: introduce debugValidate Move debug validation into a separate function. Update #538 --- prog/encoding.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'prog/encoding.go') diff --git a/prog/encoding.go b/prog/encoding.go index 1bdff4c6d..bdb00c7cc 100644 --- a/prog/encoding.go +++ b/prog/encoding.go @@ -25,11 +25,7 @@ func (p *Prog) String() string { } func (p *Prog) Serialize() []byte { - if debug { - if err := p.validate(); err != nil { - panic("serializing invalid program") - } - } + p.debugValidate() ctx := &serializer{ target: p.Target, buf: new(bytes.Buffer), -- cgit mrf-deployment