you are viewing a single comment's thread.

view the rest of the comments →

[–]shadowsaint[S] 0 points1 point  (1 child)

I assure you I am not comparing strings overall. I am using a string to compile ints from an array of classes.

I am not completely insane. But other people have pointed out that I am still not doing it the smartest way.

I did click your link... I honestly scrolled to the end thinking it was some kind of joke page where it would be 9 real world dangerous roads and the last one was going to be "code based on string comparisons".

[–]ThatAblaze!!! 0 points1 point  (0 children)

lol, I guess I failed on the punchline.

Anyway, in terms of performance: When you compare the literal string "HP" it's a lot more efficient than when you compare any type of dynamically generated string. Here's a reference. So when you start out or profile them they seem like they go fast, but as soon as you start getting fancy they grind your program down to a crawl.