Skip to content

Commit 58bfa5f

Browse files
committed
Sigh
1 parent 4a35f01 commit 58bfa5f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cmd/convert_project_js_wasm.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,12 @@ func processJavaScriptResources(resources []converters.ResourceDetails) (map[str
197197
fileMap := map[string]string{}
198198

199199
// Sort by resource type
200-
sort.Slice(&resources, func(i, j int) bool {
201-
return resources[i].ResourceType < resources[j].ResourceType
200+
resourcesSlice := resources[:]
201+
sort.Slice(resourcesSlice, func(i, j int) bool {
202+
return resourcesSlice[i].ResourceType < resourcesSlice[j].ResourceType
202203
})
203204

204-
for _, r := range resources {
205+
for _, r := range resourcesSlice {
205206
// Some resources are already resolved by their parent, but exist in the resource details map as a lookup.
206207
// In these cases, ToHclByProjectId is nil.
207208
if r.ToHcl == nil {

wasm/convert_project.wasm

-235 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)