mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:12:25 -05:00
[performance] replace uses of fmt.Sprintf() with inlineable buildURL_() and buildPath_() functions (#4374)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4374 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
12e3cb71c1
commit
e9b7e977a5
8 changed files with 223 additions and 115 deletions
|
|
@ -18,8 +18,8 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model"
|
||||
|
|
@ -71,7 +71,7 @@ func PackagePageableResponse(params PageableResponseParams) (*apimodel.PageableR
|
|||
nextRaw := params.NextMaxIDKey + "=" + params.NextMaxIDValue
|
||||
|
||||
if params.Limit != 0 {
|
||||
nextRaw = fmt.Sprintf("limit=%d&", params.Limit) + nextRaw
|
||||
nextRaw = "limit=" + strconv.Itoa(params.Limit) + "&" + nextRaw
|
||||
}
|
||||
|
||||
for _, p := range params.ExtraQueryParams {
|
||||
|
|
@ -96,7 +96,7 @@ func PackagePageableResponse(params PageableResponseParams) (*apimodel.PageableR
|
|||
prevRaw := params.PrevMinIDKey + "=" + params.PrevMinIDValue
|
||||
|
||||
if params.Limit != 0 {
|
||||
prevRaw = fmt.Sprintf("limit=%d&", params.Limit) + prevRaw
|
||||
prevRaw = "limit=" + strconv.Itoa(params.Limit) + "&" + prevRaw
|
||||
}
|
||||
|
||||
for _, p := range params.ExtraQueryParams {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue