tint: Optimization: Avoid dynamic cast in TINT_ASSERT

We don't need / want to consider whether the node in the map is of
the SemanticNodeTypeFor type.

Change-Id: Ia0deb3f4e4624bf47e2155fea05f91547d747310
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96144
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-07-18 17:03:32 +00:00 committed by Dawn LUCI CQ
parent b71bcdd45e
commit 70f7a1ee51
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ class Info {
template <typename AST> template <typename AST>
void Add(const AST* ast_node, const SemanticNodeTypeFor<AST>* sem_node) { void Add(const AST* ast_node, const SemanticNodeTypeFor<AST>* sem_node) {
// Check there's no semantic info already existing for the node // Check there's no semantic info already existing for the node
TINT_ASSERT(Semantic, Get(ast_node) == nullptr); TINT_ASSERT(Semantic, map_.find(ast_node) == map_.end());
map_.emplace(ast_node, sem_node); map_.emplace(ast_node, sem_node);
} }