Skip to content

Commit

Permalink
Fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop committed Jun 19, 2023
1 parent 48e017a commit 3fe75a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions referencer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ func BenchmarkReferencer_Fmt_full(b *testing.B) {

// Find direct reports that share same last name and manager is not named John.
qb := squirrel.StatementBuilder.Select(rf.Fmt("%s, %s", &dr.ManagerID, &dr.EmployeeID)).
From(rf.Fmt("%s AS %s", rf.Q("users"), manager)).
InnerJoin(rf.Fmt("%s AS %s ON %s = %s AND %s = %s",
rf.Q("direct_reports"), dr,
From(rf.Q("users")+rf.Fmt("AS %s", manager)).
InnerJoin(rf.Q("direct_reports")+rf.Fmt(" AS %s ON %s = %s AND %s = %s",
dr,
&dr.ManagerID, &manager.ID,
&dr.EmployeeID, &employee.ID)).
Where(rf.Fmt("%s = %s", &manager.LastName, &employee.LastName)).
Expand Down Expand Up @@ -225,9 +225,9 @@ func BenchmarkReferencer_Fmt_lite(b *testing.B) {
for i := 0; i < b.N; i++ {
// Find direct reports that share same last name and manager is not named John.
qb := squirrel.StatementBuilder.Select(rf.Fmt("%s, %s", &dr.ManagerID, &dr.EmployeeID)).
From(rf.Fmt("%s AS %s", rf.Q("users"), manager)).
InnerJoin(rf.Fmt("%s AS %s ON %s = %s AND %s = %s",
rf.Q("direct_reports"), dr,
From(rf.Q("users")+rf.Fmt(" AS %s", manager)).
InnerJoin(rf.Q("direct_reports")+rf.Fmt(" AS %s ON %s = %s AND %s = %s",
dr,
&dr.ManagerID, &manager.ID,
&dr.EmployeeID, &employee.ID)).
Where(rf.Fmt("%s = %s", &manager.LastName, &employee.LastName)).
Expand Down

0 comments on commit 3fe75a6

Please sign in to comment.