Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

What's faster to compare, strings or typeof(s) ?

$
0
0
What's faster, comparing 2 strings (pre-saved strings representing the names of the objects for example), or comparing a typeof their objects? In my list, I have doors and normal nodes; Thinking about how to actually save them, in a form of a string or each one as class instance into the list. I just need to detect wether the current index is a door or a regular node. What would you say? Thank you!

Viewing all articles
Browse latest Browse all 171066

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>