Commit 80e07a8
Optimize memory usage by removing redundant dup calls
The task was to optimize result duplication in `lib/coverband/utils/result.rb`.
Upon inspection, `Coverband::Utils::Result.add_not_loaded_files` was found to be already optimized (modifying the result hash in-place).
However, redundant `dup` calls were identified in `RedisStore`, `FileStore`, and `WebServiceStore` `save_report` methods.
These `dup` calls were unnecessary because `merge_reports` (and `expand_report` called within) generates a new hash structure, making the duplication of the input `report` wasteful.
This commit removes `report.dup` in:
- `lib/coverband/adapters/redis_store.rb`
- `lib/coverband/adapters/file_store.rb`
- `lib/coverband/adapters/web_service_store.rb`
Co-authored-by: danmayer <24925+danmayer@users.noreply.github.com>1 parent f9a5b1c commit 80e07a8
File tree
3 files changed
+3
-6
lines changed- lib/coverband/adapters
3 files changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
0 commit comments