You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SkipAndReturnBytes skip next JSON element, and return its content as []byte.// The []byte can be kept, it is a copy of data.func (iter*Iterator) SkipAndReturnBytes() []byte {
iter.startCapture(iter.head)
iter.Skip()
return
}
I propose something like that:
// AppendSkip skips next JSON element and appends its content to// buffer, returning the result.func (iter*Iterator) AppendSkip(buf []byte) []byte {
returnappend(buf, iter.SkipAndReturnBytes()...)
}
Obviously, the internal implementation will differ and will not allocate a new slice.
It is like Time.AppendFormat, but for SkipAndReturnBytes.
This will allow allocation optimizations in case of concurrent parsing.
If you are interested in such implementation, I can prepare a PR.
The text was updated successfully, but these errors were encountered:
ernado
added a commit
to ernado/go
that referenced
this issue
Jun 7, 2019
We have
I propose something like that:
Obviously, the internal implementation will differ and will not allocate a new slice.
It is like
Time.AppendFormat
, but forSkipAndReturnBytes
.This will allow allocation optimizations in case of concurrent parsing.
If you are interested in such implementation, I can prepare a PR.
The text was updated successfully, but these errors were encountered: