diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-02-04 12:11:18 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-02-04 09:11:18 -0800 |
| commit | 0d206996cd68b9f08ae1b4d9da6f16293984302c (patch) | |
| tree | 023fe84547955b1356a770f407433f45e1fb8048 /source/slang/syntax.h | |
| parent | 3726194fbe3da234eb30b6371e5b4ab1ea388f93 (diff) | |
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.
Diffstat (limited to 'source/slang/syntax.h')
| -rw-r--r-- | source/slang/syntax.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/slang/syntax.h b/source/slang/syntax.h index e354fff05..2151ed764 100644 --- a/source/slang/syntax.h +++ b/source/slang/syntax.h @@ -226,7 +226,7 @@ namespace Slang for (;;) { if (!m) return m; - if (dynamic_cast<T*>(m)) return m; + if (dynamicCast<T>(m)) return m; m = m->next.Ptr(); } } @@ -625,7 +625,7 @@ namespace Slang { while (cursor != end) { - if (dynamicCast<T>(*cursor)) + if (as<T>(*cursor)) return cursor; cursor++; } @@ -734,7 +734,7 @@ namespace Slang { for (; ptr != end; ptr++) { - if (as<T>(*ptr)) + if (ptr->is<T>()) { return ptr; } @@ -1322,7 +1322,10 @@ namespace Slang for (;;) { if (!m) return m; - if (dynamic_cast<T*>(m)) return m; + if (as<T>(m)) + { + return m; + } m = m->next.Ptr(); } } |
