preallocate stylesheet slices

This commit is contained in:
tobi 2024-03-25 18:21:44 +01:00
parent 54d53a10ef
commit aca98638e0
2 changed files with 23 additions and 6 deletions

View file

@ -140,10 +140,19 @@ func (m *Module) profileGETHandler(c *gin.Context) {
return
}
// Prepare stylesheets for profile.
stylesheets := make([]string, 0, 6)
// Basic profile stylesheets.
stylesheets := []string{
cssFA, cssStatus, cssThread, cssProfile,
}
stylesheets = append(
stylesheets,
[]string{
cssFA,
cssStatus,
cssThread,
cssProfile,
}...,
)
// User-selected theme if set.
if theme := targetAccount.Theme; theme != "" {

View file

@ -138,10 +138,18 @@ func (m *Module) threadGETHandler(c *gin.Context) {
return
}
// Prepare stylesheets for thread.
stylesheets := make([]string, 0, 5)
// Basic thread stylesheets.
stylesheets := []string{
cssFA, cssStatus, cssThread,
}
stylesheets = append(
stylesheets,
[]string{
cssFA,
cssStatus,
cssThread,
}...,
)
// User-selected theme if set.
if theme := targetAccount.Theme; theme != "" {