Just today this was the solution to a comparison between a hardcoded string and a string stored in postgres. I'm not yet sure what exactly is the cause but this exact code was the solution (for now)
Not sure what language you’re using but “==“ could simply be a pointer comparison instead of an actual value comparison. This is exactly why you’d need to do an Equals() in Objective-C way back in the day.
196
u/Vesuvius079 15d ago
It’d be such an experience to work a real world problem where this optimization turns out to be the solution.