Skip to content

Commit f002086

Browse files
authored
Merge pull request #790 from JuliaRobotics/21Q3/enh/unpackimpr
slight improvement to serialization code
2 parents b123fb8 + 168c4a8 commit f002086

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/Serialization.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ function unpackVariable(dfg::G,
150150
ppeDict = unpackPPEs ? JSON2.read(packedProps["ppeDict"], Dict{Symbol, MeanMaxPPE}) : Dict{Symbol, MeanMaxPPE}()
151151
smallData = JSON2.read(packedProps["smallData"], Dict{Symbol, SmallDataTypes})
152152

153-
if haskey(packedProps, "softtype")
153+
variableTypeString = if haskey(packedProps, "softtype")
154154
# TODO Deprecate, remove in v0.12
155155
@warn "Packed field `softtype` is deprecated and replaced with `variableType`"
156-
variableTypeString = packedProps["softtype"]
156+
packedProps["softtype"]
157157
else
158-
variableTypeString = packedProps["variableType"]
158+
packedProps["variableType"]
159159
end
160160

161161
variableType = getTypeFromSerializationModule(variableTypeString)
@@ -220,7 +220,7 @@ end
220220
# returns a PackedVariableNodeData
221221
function packVariableNodeData(::G, d::VariableNodeData{T}) where {G <: AbstractDFG, T <: InferenceVariable}
222222
@debug "Dispatching conversion variable -> packed variable for type $(string(d.variableType))"
223-
# @show d.val
223+
# TODO change to Vector{Vector{Float64}} which can be directly packed by JSON
224224
castval = if 0 < length(d.val)
225225
precast = getCoordinates.(T, d.val)
226226
@cast castval[i,j] := precast[j][i]

0 commit comments

Comments
 (0)