Skip to content

Commit

Permalink
Simplify zson.Formatter.FormatRecord (#4895)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwt authored Nov 22, 2023
1 parent 6d8abb5 commit 79aa231
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions zson/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ func (f *Formatter) pop() {
}

func (f *Formatter) FormatRecord(rec *zed.Value) string {
f.builder.Reset()
// We reset tyepdefs so named types are emitted with their
// definition at first use in each record according to the
// left-to-right DFS order. We could make this more efficient
// by putting a record number/nonce in the map but ZSON
// is already intended to be the low performance path.
f.typedefs = make(map[string]*zed.TypeNamed)
f.formatValueAndDecorate(rec.Type, rec.Bytes())
return f.builder.String()
return f.Format(rec)
}

func FormatValue(val *zed.Value) string {
Expand Down

0 comments on commit 79aa231

Please sign in to comment.