mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
tint: Replace type::UniqueNode::Hash() virtual with field
Virtual methods are expensive to call, and hashes are frequently tested. The hash must be immutable, so just calculate it once in the constructor and store it as an immutable field. Change-Id: I9d29fb3fc074e57e7af91367768a47193baa40f1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114780 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
ada5e7b0f9
commit
ce93a6b224
@@ -57,11 +57,10 @@ constexpr static const size_t kNumFixedCandidates = 8;
|
||||
/// A special type that matches all TypeMatchers
|
||||
class Any final : public Castable<Any, type::Type> {
|
||||
public:
|
||||
Any() : Base(type::Flags{}) {}
|
||||
Any() : Base(0u, type::Flags{}) {}
|
||||
~Any() override = default;
|
||||
|
||||
// Stub implementations for type::Type conformance.
|
||||
size_t Hash() const override { return 0; }
|
||||
bool Equals(const type::UniqueNode&) const override { return false; }
|
||||
std::string FriendlyName(const SymbolTable&) const override { return "<any>"; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user