mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
resources: Optimize reading resource Content when it's already a string
This commit is contained in:
@@ -418,12 +418,7 @@ func (l *genericResource) Content(context.Context) (any, error) {
|
||||
}
|
||||
defer r.Close()
|
||||
|
||||
var b []byte
|
||||
b, err = io.ReadAll(r)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(b), nil
|
||||
return hugio.ReadString(r)
|
||||
}
|
||||
|
||||
func (r *genericResource) Err() resource.ResourceError {
|
||||
|
Reference in New Issue
Block a user