Skip to content

Commit cbbebba

Browse files
YingboMabaggepinnen
andcommitted
Use BitSet
Co-authored-by: Fredrik Bagge Carlson <[email protected]>
1 parent 52785a9 commit cbbebba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/systems/clock_inference.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ struct ClockInference
22
ts::TearingState
33
eq_domain::Vector{TimeDomain}
44
var_domain::Vector{TimeDomain}
5-
# maybe BitSet
6-
inferred::Vector{Int}
5+
inferred::BitSet
76
end
87

98
function ClockInference(ts::TearingState)
109
@unpack fullvars, structure = ts
1110
@unpack graph = structure
1211
eq_domain = Vector{TimeDomain}(undef, nsrcs(graph))
1312
var_domain = Vector{TimeDomain}(undef, ndsts(graph))
14-
inferred = Int[]
13+
inferred = BitSet()
1514
for (i, v) in enumerate(fullvars)
1615
d = get_time_domain(v)
1716
if d isa Union{AbstractClock, Continuous}
@@ -41,7 +40,6 @@ function infer_clocks!(ci::ClockInference)
4140
end
4241
end
4342
cc = connected_components(var_graph)
44-
inferred = BitSet(inferred)
4543
for c′ in cc
4644
c = BitSet(c′)
4745
idxs = intersect(c, inferred)

0 commit comments

Comments
 (0)