How to efficiently transform vector structures without unnecessary allocation? We have two structures:
struct ApiData
name::String
reload::Vector{ApiReload}
values::Vector{Vector{Float64}}
end
struct ApiReload
status::String
time::Sting #Transform to sturcture "TimeOfDay"
end
which make the vector a = Vector{ApiData}
. Now we want to transform the vector a into vector b which has the form of three structures:
struct Data
name::String
reload::Vector{Reload}
values::Vector{Vector{Float64}}
end
struct Reload
status::String
time::TimeOfDay
end
struct TimeOfDay
minutes::Array{Int}
hours::Array{Int}
end
Vector b has the form of Vector{Data}
, with percentage members in the Data
structure (name =1%, reload=4% and values 95%).