forked from gohugoio/hugo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make replaceShortcodeTokens rewrite the input slice
Currently a `[]byte` copy is returned. In most cases this is the safe thing to do, but we should just modify/grow the slice as needed. This is faster and consumes less memory: ``` benchmark old ns/op new ns/op delta BenchmarkReplaceShortcodeTokens-4 7350 4419 -39.88% benchmark old allocs new allocs delta BenchmarkReplaceShortcodeTokens-4 5 1 -80.00% benchmark old bytes new bytes delta BenchmarkReplaceShortcodeTokens-4 4816 1152 -76.08% ``` This commit is aso a small spring cleaning of duplicated code in the different `PageConvert` methods. Fixes gohugoio#1516
- Loading branch information
Showing
4 changed files
with
32 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters