Skip to content

Commit

Permalink
Use some nicer capacity defaults when creating a page object
Browse files Browse the repository at this point in the history
Signed-off-by: Sandy <sandy@sandyuraz.com>
  • Loading branch information
thecsw committed Jan 13, 2023
1 parent 966f103 commit 929d803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion parse/orgmode/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (p ParserOrgmode) Parse() *yunyun.Page {
page := yunyun.NewPage(
yunyun.WithFilename(p.Filename),
yunyun.WithLocation(yunyun.RelativePathTrim(p.Filename)),
yunyun.WithContents(make([]*yunyun.Content, 0, 16)),
yunyun.WithContents(make([]*yunyun.Content, 0, 32)),
)

// currentFlags uses flags to set options
Expand Down
12 changes: 6 additions & 6 deletions yunyun/page_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ func NewPage(options ...PageOption) *Page {
Date: defaultDate,
DateHoloscene: defaulteDateHoloscene,
Location: defaultURL,
Contents: Contents{},
Footnotes: []string{},
Scripts: []string{},
Stylesheets: []string{},
HtmlHead: []string{},
Contents: nil,
Footnotes: make([]string, 0, 2),
Scripts: make([]string, 0, 4),
Stylesheets: make([]string, 0, 2),
HtmlHead: make([]string, 0, 2),
Accoutrement: &Accoutrement{
ExcludeHtmlHeadContains: ExcludeHtmlHeadContains{},
ExcludeHtmlHeadContains: make([]string, 0, 2),
},
}
return p.Options(options...)
Expand Down

0 comments on commit 929d803

Please sign in to comment.