Den 14.06.2011 23:03, skrev Greg Brown:
It would have to do null-checks, or switch to if
(!tabData.equals(previousTabData)), but even then, ButtonData would need an
equals() method. If the equals() method checked the text and userData
properties (and skip the Image) that would work :)
That's a good point, too. I definitely wouldn't want to incur the performance
penalty of a byte-by-byte image comparison! Though it is probably OK to do a
reference equality check for images, since they are often shared within an app.
The more I think about it, the more I believe that there shouldn't be
any comparison and that the caller should decide. If you call the
method, you want a redraw, so any equals() method would only add
overhead, and possibly stop the update you explicitly called for.