[PR #582] [MERGED] fix: simplify parallel map using channels #9656

Closed
opened 2026-02-16 18:13:56 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/582
Author: @craigandrews
Created: 7/1/2025
Status: Merged
Merged: 7/3/2025
Merged by: @adamdotdevin

Base: devHead: dev


📝 Commits (1)

  • b46417e fix: simplify parallel map using channels

📊 Changes

2 files changed (+45 additions, -32 deletions)

View changed files

📝 packages/tui/internal/util/concurrency.go (+22 -32)
packages/tui/internal/util/concurrency_test.go (+23 -0)

📄 Description

The indexed arrays of locks used in the existing MapReducePar function are complex and brittle. Instead, make use of the inherent synchronization of channels. Also, simplify the reduce phase to a for loop.


🔄 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/anomalyco/opencode/pull/582 **Author:** [@craigandrews](https://github.com/craigandrews) **Created:** 7/1/2025 **Status:** ✅ Merged **Merged:** 7/3/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`b46417e`](https://github.com/anomalyco/opencode/commit/b46417e9a81ac00eac185ab8b2b969738fbc41b6) fix: simplify parallel map using channels ### 📊 Changes **2 files changed** (+45 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `packages/tui/internal/util/concurrency.go` (+22 -32) ➕ `packages/tui/internal/util/concurrency_test.go` (+23 -0) </details> ### 📄 Description The indexed arrays of locks used in the existing MapReducePar function are complex and brittle. Instead, make use of the inherent synchronization of channels. Also, simplify the reduce phase to a for loop. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:56 -05:00
yindo closed this issue 2026-02-16 18:13:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9656