internal/ops: hide Ops methods by converting them to package functions

Ops is in the internal package ops, but external clients can reach its
method through op.Ops.Internal. Hide them by converting them to internal
package functions.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-10-12 14:38:13 +02:00
parent 87d050bcc7
commit 0048f7be1d
9 changed files with 66 additions and 66 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ func (r *Reader) Reset(ops *Ops) {
// ResetAt is like Reset, except it starts reading from pc.
func (r *Reader) ResetAt(ops *Ops, pc PC) {
r.stack = r.stack[:0]
r.deferOps.Reset()
Reset(&r.deferOps)
r.deferDone = false
r.pc = pc
r.ops = ops
@@ -120,7 +120,7 @@ func (r *Reader) Decode() (EncodedOp, bool) {
if t.NumRefs() != 1 {
panic("internal error: unexpected number of macro refs")
}
deferData := r.deferOps.Write1(t.Size(), refs[0])
deferData := Write1(&r.deferOps, t.Size(), refs[0])
copy(deferData, data)
r.pc.data += n
r.pc.refs += nrefs