avoid unneccesary OGDesc allocs
This commit is contained in:
parent
8d19048c0d
commit
20ce00f434
|
@ -75,11 +75,13 @@ func ViewTopic(w http.ResponseWriter, r *http.Request, user c.User, header *c.He
|
||||||
}
|
}
|
||||||
|
|
||||||
topic.ContentLines = strings.Count(topic.Content, "\n")
|
topic.ContentLines = strings.Count(topic.Content, "\n")
|
||||||
|
if !user.Loggedin && user.LastAgent != c.Semrush {
|
||||||
if len(topic.Content) > 200 {
|
if len(topic.Content) > 200 {
|
||||||
header.OGDesc = topic.Content[:197] + "..."
|
header.OGDesc = topic.Content[:197] + "..."
|
||||||
} else {
|
} else {
|
||||||
header.OGDesc = topic.Content
|
header.OGDesc = topic.Content
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var parseSettings *c.ParseSettings
|
var parseSettings *c.ParseSettings
|
||||||
if !postGroup.Perms.AutoEmbed && (user.ParseSettings == nil || !user.ParseSettings.NoEmbed) {
|
if !postGroup.Perms.AutoEmbed && (user.ParseSettings == nil || !user.ParseSettings.NoEmbed) {
|
||||||
|
|
Loading…
Reference in New Issue