Skip to content

Commit d488f98

Browse files
committed
up
1 parent afb89f0 commit d488f98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/reactionsystem.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ function Reaction(rate, subs, prods, substoich, prodstoich;
187187
end
188188

189189
# Check that all metadata entries are unique. (cannot use `in` since some entries may be symbolics).
190-
if any(any(isequal(metadata[i][1], entry[1]) for entry in metadata[i+1:end])
191-
for i in eachindex(metadata))
190+
if !allunique(entry[1] for entry in metadata)
192191
error("Repeated entries for the same metadata encountered in the following metadata set: $([entry[1] for entry in metadata]).")
193192
end
194193

@@ -205,8 +204,9 @@ end
205204

206205
# Checks if a metadata input has an entry :only_use_rate => true
207206
function metadata_only_use_rate_check(metadata)
208-
any(:only_use_rate == entry[1] for entry in metadata) || (return false)
209-
return Bool(metadata[findfirst(:only_use_rate == entry[1] for entry in metadata)][2])
207+
only_use_rate_idx = findfirst(:only_use_rate == entry[1] for entry in metadata)
208+
isnothing(only_use_rate_idx) && return true
209+
return Bool(metadata[only_use_rate_idx][2])
210210
end
211211

212212
# three argument constructor assumes stoichiometric coefs are one and integers

0 commit comments

Comments
 (0)