Calculate filename hash only once#19654
Merged
Merged
Conversation
lunny
approved these changes
May 8, 2022
wxiaoguang
reviewed
May 8, 2022
Contributor
|
After reading the code again, I found that the helper function I just made two small changes:
|
wxiaoguang
approved these changes
May 8, 2022
6543
approved these changes
May 8, 2022
delvh
approved these changes
May 8, 2022
Codecov Report
@@ Coverage Diff @@
## main #19654 +/- ##
=======================================
Coverage ? 47.36%
=======================================
Files ? 956
Lines ? 133417
Branches ? 0
=======================================
Hits ? 63192
Misses ? 62587
Partials ? 7638
Continue to review full report at Codecov.
|
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
May 9, 2022
* giteaofficial/main: [skip ci] Updated translations via Crowdin Calculate filename hash only once (go-gitea#19654) Admin should not delete himself (go-gitea#19423) Restore reviewed-on message (go-gitea#19657) Move some helper files out of models (go-gitea#19355) Repository level enable package or disable (go-gitea#19323)
AbdulrhmnGhanem
pushed a commit
to kitspace/gitea
that referenced
this pull request
Aug 24, 2022
* Calculate hash only once. * remove unused Sha1 template helper function, use ctx.Data["FileNameHash"] * fix unit tests
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When rendering a diff we currently calculate the SHA1 hash of the filename for every row. This PR calculates the hash only once. It may not be measurable but saves some cpu cycles.