[PR #1534] [MERGED] markup: microoptimise for many short filenames in directory #15948

Closed
opened 2025-11-02 11:58:42 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1534
Author: @mappu
Created: 4/23/2017
Status: Merged
Merged: 5/9/2017
Merged by: @lunny

Base: masterHead: mappu-patch-isreadmefile


📝 Commits (2)

  • 1c732ef markup: microoptimise for many short filenames in directory
  • aa36c4c markup: expand test cases for IsReadmeFile()

📊 Changes

2 files changed (+6 additions, -2 deletions)

View changed files

📝 modules/markup/markup.go (+5 -2)
📝 modules/markup/markup_test.go (+1 -0)

📄 Description

Move strings.ToLower() after the early-return length check. This is a safe operation in all cases and should slightly improve directory listing performance when a directory contains many thousands of files with short filenames.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/1534 **Author:** [@mappu](https://github.com/mappu) **Created:** 4/23/2017 **Status:** ✅ Merged **Merged:** 5/9/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `mappu-patch-isreadmefile` --- ### 📝 Commits (2) - [`1c732ef`](https://github.com/go-gitea/gitea/commit/1c732ef89113d58039456c2e9a43a8f1341a48d6) markup: microoptimise for many short filenames in directory - [`aa36c4c`](https://github.com/go-gitea/gitea/commit/aa36c4c1ad55d081d458ff2c5f5aa88600f12a92) markup: expand test cases for IsReadmeFile() ### 📊 Changes **2 files changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `modules/markup/markup.go` (+5 -2) 📝 `modules/markup/markup_test.go` (+1 -0) </details> ### 📄 Description Move strings.ToLower() after the early-return length check. This is a safe operation in all cases and should slightly improve directory listing performance when a directory contains many thousands of files with short filenames. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:58:42 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15948