From 70f7a1ee51c5759bf104fdbe3e76051f0d8138fd Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 18 Jul 2022 17:03:32 +0000 Subject: [PATCH] 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 Commit-Queue: Ben Clayton --- src/tint/sem/info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tint/sem/info.h b/src/tint/sem/info.h index 182e5946aa..aa98ff0c92 100644 --- a/src/tint/sem/info.h +++ b/src/tint/sem/info.h @@ -79,7 +79,7 @@ class Info { template void Add(const AST* ast_node, const SemanticNodeTypeFor* sem_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); }