c.String() performance improvements
``` benchmark old ns/op new ns/op delta BenchmarkOneRouteString 448 310 -30.80% benchmark old allocs new allocs delta BenchmarkOneRouteString 1 0 -100.00% benchmark old bytes new bytes delta BenchmarkOneRouteString 48 0 -100.00% ```
This commit is contained in:
@ -320,10 +320,8 @@ func (c *Context) XML(code int, obj interface{}) {
|
||||
|
||||
// Writes the given string into the response body.
|
||||
func (c *Context) String(code int, format string, values ...interface{}) {
|
||||
c.Render(code, render.String{
|
||||
Format: format,
|
||||
Data: values},
|
||||
)
|
||||
c.writermem.WriteHeader(code)
|
||||
render.WriteString(c.Writer, format, values)
|
||||
}
|
||||
|
||||
// Returns a HTTP redirect to the specific location.
|
||||
|
Reference in New Issue
Block a user