Skip to content

Commit

Permalink
Interface.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
cossio committed Jul 6, 2023
1 parent 66d9275 commit 735537c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function createbranch! end
error("Tree does not have an available destination node called " *
_getnodename(tree, dn))
sn dn || error("Branch must connect different nodes")

return ismissing(data) ?
_createbranch!(tree, sn, dn, len, name) :
_createbranch!(tree, sn, dn, len, name, data)
Expand All @@ -348,7 +348,7 @@ end
error("Tree does not have an available destination node called " *
_getnodename(tree, dst))
src dst || error("Branch must connect different nodes")

return ismissing(data) ?
_createbranch!(tree, src, dst, len, name) :
_createbranch!(tree, src, dst, len, name, data)
Expand All @@ -371,7 +371,7 @@ end
error("Tree does not have an available destination node called " *
_getnodename(tree, dn))
sn dn || error("Branch must connect different nodes")

return ismissing(data) ?
_createbranch!(tree, sn, dn, len, name) :
_createbranch!(tree, sn, dn, len, name, data)
Expand All @@ -392,7 +392,7 @@ end
error("Tree does not have an available destination node called " *
_getnodename(tree, dst))
src dst || error("Branch must connect different nodes")

return ismissing(data) ?
_createbranch!(tree, src, dst, len, name) :
_createbranch!(tree, src, dst, len, name, data)
Expand Down Expand Up @@ -644,7 +644,7 @@ function isleaf end
end
@traitfn function isleaf(tree::T, node::N) where
{T <: AbstractTree{OneTree}, N; MatchNodeType{T, N}}
_hasnode(tree, node) || error("Node $node does not exist")
_hasnode(tree, node) || error("Node $node does not exist")
return _isleaf(tree, node)
end

Expand Down Expand Up @@ -1036,12 +1036,12 @@ Return the length of this branch.
"""
function getlength end
@traitfn function getlength(tree::T, branch::B) where
{T <: AbstractTree{OneTree}, B, N; !MatchBranchType{T, B}}
{T <: AbstractTree{OneTree}, B; !MatchBranchType{T, B}}
hasbranch(tree, branch) || error("Branch $branch does not exist")
return _getlength(tree, _getbranch(tree, branch))
end
@traitfn function getlength(tree::T, branch::B) where
{T <: AbstractTree{OneTree}, B, N; MatchBranchType{T, B}}
{T <: AbstractTree{OneTree}, B; MatchBranchType{T, B}}
_hasbranch(tree, branch) || error("Branch $branch does not exist")
return _getlength(tree, branch)
end
Expand Down

0 comments on commit 735537c

Please sign in to comment.