Commit 1447fa7
Remove unused index variable from producer-consumer queue
The index was being created, enqueued, and then ignored in the writer.
There's no ordering logic that uses it - the queue itself maintains
FIFO order.
Changes:
- Remove `each_with_index` in build_producer_tasks (use `map`)
- Enqueue chunks directly instead of `[idx, chunk]` pairs
- Remove destructuring in build_writer_task
- Simplify variable names (pair -> chunk, item -> chunk)
Benefits:
- Cleaner code
- Slight performance improvement (no array allocation per chunk)
- Removes misleading code (index suggested ordering logic that didn't exist)
Verified: All 21 tests in stream_spec.rb still pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 056502a commit 1447fa7
1 file changed
+5
-6
lines changedLines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
0 commit comments