-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Didn't know that made a difference for strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.