-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate filename hash only once #19654
Conversation
After reading the code again, I found that the helper function I just made two small changes:
|
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.
|
* 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)
* Calculate hash only once. * remove unused Sha1 template helper function, use ctx.Data["FileNameHash"] * fix unit tests
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.