Commit bb33548c authored by Geoff Simmons's avatar Geoff Simmons

Refactor Query a bit to reduce allocations.

parent 3b04d58d
......@@ -76,7 +76,7 @@ func atoUint32(bytes []byte) (uint32, bool) {
// function.
type Query struct {
cursor *Cursor
incomplete map[uint32]*Tx
incomplete map[uint32]Tx
grp Grouping
}
......@@ -122,7 +122,7 @@ func (c *Cursor) NewQuery(grp Grouping, query string) (*Query, error) {
if err := c.log.checkNil(); err != nil {
return nil, err
}
txMap := make(map[uint32]*Tx)
txMap := make(map[uint32]Tx)
return &Query{cursor: c, grp: grp, incomplete: txMap}, nil
}
......@@ -156,9 +156,10 @@ func (q *Query) NextTxGroup() ([]Tx, Status) {
incmplTx.Records = append(incmplTx.Records, rec)
if rec.Tag == Tag(C.SLT_End) {
delete(q.incomplete, vxid32)
txGrp := []Tx{*incmplTx}
txGrp := []Tx{incmplTx}
return txGrp, status
}
q.incomplete[vxid32] = incmplTx
continue
}
......@@ -183,6 +184,6 @@ func (q *Query) NextTxGroup() ([]Tx, Status) {
tx.Reason = reason
}
}
q.incomplete[vxid32] = &tx
q.incomplete[vxid32] = tx
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment