cuchaz, Once again I get foiled by switching languages. :blobcatfacepalm2:
In Javascript, you have to compare strings with
===
, not==
, or else you'll run into type coercion problems, because Javascript thinks 1 == "1" is a totally fine thing to be true. (it's not)But in Kotlin,
===
compares identity not equality for strings. But in the JVM, string values are aggressively cached, so===
actually does what you want most of the time. Unless your strings come from weird places, like JNI code. Then you get awful non-deterministic behavior that's incredibly hard to debug, but it totally goes away when you use the correct comparison operator==
for strings.sigh I'm not really as good at this whole programming thing as I should be by now.
Add comment