Skip to content

Instantly share code, notes, and snippets.

@doom369
Created July 27, 2020 07:00
Show Gist options
  • Save doom369/929eddd9a04b8175e2075aca3f194000 to your computer and use it in GitHub Desktop.
Save doom369/929eddd9a04b8175e2075aca3f194000 to your computer and use it in GitHub Desktop.
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
}
if (anObject instanceof String) {
String aString = (String)anObject;
if (coder() == aString.coder()) {
return isLatin1() ? StringLatin1.equals(value, aString.value)
: StringUTF16.equals(value, aString.value);
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment