Skip to content

Commit 34a7f5f

Browse files
Reserve state_ids size.
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
1 parent 765598f commit 34a7f5f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • src/log_surgeon/finite_automata

src/log_surgeon/finite_automata/Dfa.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ auto Dfa<TypedDfaState, TypedNfaState>::serialize() const -> std::string {
178178
auto const traversal_order = get_bfs_traversal_order();
179179

180180
std::unordered_map<TypedDfaState const*, uint32_t> state_ids;
181+
state_ids.reserve(traversal_oerder.size());
181182
for (auto const* state : traversal_order) {
182183
state_ids.emplace(state, state_ids.size());
183184
}

0 commit comments

Comments
 (0)