Para quem ainda não sabe, segue um trecho do livro Java Performance Tuning que compara o desempenho do método equalsIgnoreCase() com o método equals():
"On the other hand, if the two strings are different in size, equalsIgnoreCase() has only two tests to make before it returns, whereas equals() makes four tests before it returns. This can make equalsIgnoreCase() run 20% faster than equals() for what may be the most common difference between strings."
0 comentários:
Postar um comentário