From 0d206996cd68b9f08ae1b4d9da6f16293984302c Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 Feb 2019 12:11:18 -0500 Subject: Feature/casting tidyup (#822) * Use 'is' over 'as' where appropriate. * dynamic_cast -> dynamicCast * Replace 'dynamicCast' with 'as' where has no change in behavior/ambiguity. * Replace dynamicCast with as where doesn't change behavior/non ambiguous. --- source/slang/lookup.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/lookup.cpp') diff --git a/source/slang/lookup.cpp b/source/slang/lookup.cpp index 0ded328c7..2c822eb15 100644 --- a/source/slang/lookup.cpp +++ b/source/slang/lookup.cpp @@ -45,7 +45,7 @@ void buildMemberDictionary(ContainerDecl* decl) decl->transparentMembers.Clear(); // are we a generic? - GenericDecl* genericDecl = dynamic_cast(decl); + GenericDecl* genericDecl = as(decl); for (auto m : decl->Members) { @@ -84,21 +84,21 @@ void buildMemberDictionary(ContainerDecl* decl) bool DeclPassesLookupMask(Decl* decl, LookupMask mask) { // type declarations - if(auto aggTypeDecl = dynamic_cast(decl)) + if(auto aggTypeDecl = as(decl)) { return int(mask) & int(LookupMask::type); } - else if(auto simpleTypeDecl = dynamic_cast(decl)) + else if(auto simpleTypeDecl = as(decl)) { return int(mask) & int(LookupMask::type); } // function declarations - else if(auto funcDecl = dynamic_cast(decl)) + else if(auto funcDecl = as(decl)) { return (int(mask) & int(LookupMask::Function)) != 0; } // attribute declaration - else if( auto attrDecl = dynamic_cast(decl) ) + else if( auto attrDecl = as(decl) ) { return (int(mask) & int(LookupMask::Attribute)) != 0; } -- cgit v1.2.3