[PR #879] [MERGED] Improve status table implementation #15630

Closed
opened 2025-11-02 11:51:04 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/879
Author: @minecrafter
Created: 2/9/2017
Status: Merged
Merged: 2/9/2017
Merged by: @lunny

Base: masterHead: remove-superfluous-defer


📝 Commits (2)

  • ddfa396 Remove superfluous defer calls
  • 5781c02 Improve status table implementation as well

📊 Changes

3 files changed (+29 additions, -12 deletions)

View changed files

📝 modules/sync/status_pool.go (+9 -11)
modules/sync/status_pool_test.go (+19 -0)
📝 modules/sync/unique_queue.go (+1 -1)

📄 Description

This pull request improves the status table implementation in a few ways:

  • Removes defer calls. Using defer to cover reading or modifying a map is superfluous.
  • Change underlying data structure from map[string]bool to a map[string]struct{}, which is more appropriate as this is essentially a thread-safe set.
  • Adds testing.

🔄 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/879 **Author:** [@minecrafter](https://github.com/minecrafter) **Created:** 2/9/2017 **Status:** ✅ Merged **Merged:** 2/9/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `remove-superfluous-defer` --- ### 📝 Commits (2) - [`ddfa396`](https://github.com/go-gitea/gitea/commit/ddfa39649079beab8161c8eb45a413d8b4f7d5a4) Remove superfluous defer calls - [`5781c02`](https://github.com/go-gitea/gitea/commit/5781c02d49ea9ac79f359693924f58803b24abd1) Improve status table implementation as well ### 📊 Changes **3 files changed** (+29 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `modules/sync/status_pool.go` (+9 -11) ➕ `modules/sync/status_pool_test.go` (+19 -0) 📝 `modules/sync/unique_queue.go` (+1 -1) </details> ### 📄 Description This pull request improves the status table implementation in a few ways: * Removes `defer` calls. Using `defer` to cover reading or modifying a map is superfluous. * Change underlying data structure from `map[string]bool` to a `map[string]struct{}`, which is more appropriate as this is essentially a thread-safe set. * Adds testing. --- <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:51:04 -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#15630