Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishapi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishapi
Commits
bb33548c
Commit
bb33548c
authored
Aug 30, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Query a bit to reduce allocations.
parent
3b04d58d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
query.go
pkg/log/query.go
+5
-4
No files found.
pkg/log/query.go
View file @
bb33548c
...
...
@@ -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
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment