Skip to content

Commit c66e2b8

Browse files
committed
some code cleanup, more dispatch possible
1 parent 609b3b3 commit c66e2b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,11 @@ Get a deep subgraph copy from the DFG given a list of variables and factors.
739739
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
740740
Note: By default orphaned factors (where the subgraph does not contain all the related variables) are not returned. Set includeOrphanFactors to return the orphans irrespective of whether the subgraph contains all the variables.
741741
"""
742-
function getSubgraph(dfg::CloudGraphsDFG, variableFactorLabels::Vector{Symbol}, includeOrphanFactors::Bool=false, addToDFG::Union{Nothing, CloudGraphsDFG}=nothing)::CloudGraphsDFG
742+
function getSubgraph(dfg::CloudGraphsDFG,
743+
variableFactorLabels::Vector{Symbol},
744+
includeOrphanFactors::Bool=false,
745+
addToDFG::G=_getDuplicatedEmptyDFG(dfg) )::G where {G <: AbstractDFG}
743746
# Making a copy session if not specified
744-
if addToDFG == nothing
745-
addToDFG = _getDuplicatedEmptyDFG(dfg)
746-
end
747747

748748
_copyIntoGraph!(dfg, addToDFG, variableFactorLabels, includeOrphanFactors)
749749

0 commit comments

Comments
 (0)