RFR: 8274163: Use String.equals instead of String.compareTo in jdk.jcmd

Serguei Spitsyn sspitsyn at openjdk.java.net
Wed Sep 22 20:27:57 UTC 2021


On Wed, 22 Sep 2021 19:14:03 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> In several places, String.compareTo was _compared_ with 0 ( via `== 0` or `!= 0`).
> Instead of this, we can use String.equals calls. `String.equals` is faster and shorter.

Looks good.
Thanks,
Serguei

-------------

Marked as reviewed by sspitsyn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5637


More information about the serviceability-dev mailing list