Dont show metadata title if it matches the post title.#1370
Conversation
| text = post.embed_title!!, | ||
| style = MaterialTheme.typography.titleLarge, | ||
| ) | ||
| if (post.name !== post.embed_title) { |
There was a problem hiding this comment.
Isn't triple equals direct reference comparison? Isn't this not guaranteed to be true for strings? (Two the dame strings can have different references) Or did they change this behaviour with Kotlin? Either way I would do !=
There was a problem hiding this comment.
Fixed. Didn't know that made a difference for strings.
There was a problem hiding this comment.
In Java each (string) object has its own unique ref, == is a direct reference comparison and equals is the overloaded logical comparison. But Java caches Strings and thus returns sometimes the same ref for the same string. So it works for some cases but not all. In Kotlin == is logical comparison (the equals) and === is the reference comparison
No description provided.