From 6d6692105303da31ac0df301f621ecae834863f7 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 3 Aug 2022 08:00:15 +0000 Subject: [PATCH] tint/resolver: Reduce small-vector sizes The vector sizes for expression traversal were excessive. Reduce. Change-Id: I3a2b7e7ba4cd82310565b883f85322834275ea8a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98082 Reviewed-by: Dan Sinclair Commit-Queue: Ben Clayton --- src/tint/ast/traverse_expressions.h | 2 +- src/tint/resolver/resolver.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tint/ast/traverse_expressions.h b/src/tint/ast/traverse_expressions.h index f4e4716647..bcf0bfde1c 100644 --- a/src/tint/ast/traverse_expressions.h +++ b/src/tint/ast/traverse_expressions.h @@ -68,7 +68,7 @@ bool TraverseExpressions(const ast::Expression* root, diag::List& diags, CALLBAC size_t depth; }; - utils::Vector to_visit{{root, 0}}; + utils::Vector to_visit{{root, 0}}; auto push_single = [&](const ast::Expression* expr, size_t depth) { to_visit.Push({expr, depth}); diff --git a/src/tint/resolver/resolver.cc b/src/tint/resolver/resolver.cc index 4295babbd7..ab25bfbe1f 100644 --- a/src/tint/resolver/resolver.cc +++ b/src/tint/resolver/resolver.cc @@ -1276,7 +1276,7 @@ sem::WhileStatement* Resolver::WhileStatement(const ast::WhileStatement* stmt) { } sem::Expression* Resolver::Expression(const ast::Expression* root) { - utils::Vector sorted; + utils::Vector sorted; constexpr size_t kMaxExpressionDepth = 512U; bool failed = false; if (!ast::TraverseExpressions(