Skip to content

Commit 9ec45b1

Browse files
authored
Reduce allocations on Itoa conversion (go-gorm#85)
1 parent 5d3e5f9 commit 9ec45b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sqlite.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder {
101101
if limit.Limit <= 0 {
102102
limit.Limit = -1
103103
}
104-
builder.WriteString("LIMIT " + strconv.Itoa(limit.Limit))
104+
builder.WriteString("LIMIT ")
105+
builder.WriteString(strconv.Itoa(limit.Limit))
105106
}
106107
if limit.Offset > 0 {
107-
builder.WriteString(" OFFSET " + strconv.Itoa(limit.Offset))
108+
builder.WriteString(" OFFSET ")
109+
builder.WriteString(strconv.Itoa(limit.Offset))
108110
}
109111
}
110112
},

0 commit comments

Comments
 (0)