Skip to content

Commit 4621272

Browse files
committed
Fix bug in idToIndex
1 parent 4d45c83 commit 4621272

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/analysis/tracers.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ function idToIndex(data_dict::Dict, target_ids::Vector{<:Unsigned})::Dict{Symbol
116116
# Read the IDs of the cells/particles
117117
ids = data["ID "]
118118

119-
if !isempty(ids)
119+
idxs = Int[]
120120

121-
idxs = Vector{Int}()
121+
if !isempty(ids)
122122

123123
# Find the indices of the target IDs in the cell/particle ID list
124124
for (i, id) in pairs(ids)
@@ -127,12 +127,10 @@ function idToIndex(data_dict::Dict, target_ids::Vector{<:Unsigned})::Dict{Symbol
127127
end
128128
end
129129

130-
else
131-
132-
index_dict[component] = Int[]
133-
134130
end
135131

132+
index_dict[component] = idxs
133+
136134
end
137135

138136
return index_dict

0 commit comments

Comments
 (0)