Skip to content

Commit

Permalink
sort labels
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 committed Mar 13, 2017
1 parent f0c02f7 commit 1f90c01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ function state_condition(s::Int)
end

function generate_condition_code(edge::Edge, actions::Dict{Symbol,Expr})
labelcode = foldr((range, cond) -> Expr(:||, :(l in $(range)), cond), :(false), range_encode(edge.labels))
labelcode = foldr((range, cond) -> Expr(:||, :(l in $(range)), cond), :(false),
sort(range_encode(edge.labels), by=length, rev=true))
precondcode = foldr(:(true), edge.precond) do p, ex
name, value = p
if value == BOTH
Expand Down

0 comments on commit 1f90c01

Please sign in to comment.