Skip to content

Commit

Permalink
perf: Faster building of a validator (#537)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 authored Sep 30, 2024
1 parent c916e2c commit f0382fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/jsonschema-referencing/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ fn process_resources(
anchors: &mut AHashMap<AnchorKey, Anchor>,
default_draft: Draft,
) -> Result<(), Error> {
let mut queue = VecDeque::new();
let mut queue = VecDeque::with_capacity(32);
let mut external = AHashSet::new();

// Populate the resources & queue from the input
Expand All @@ -286,7 +286,7 @@ fn process_resources(
queue.push_back((uri, resource));
}

let mut stack = vec![];
let mut stack = Vec::with_capacity(32);

loop {
if queue.is_empty() && external.is_empty() {
Expand Down

0 comments on commit f0382fc

Please sign in to comment.