Re: RFR: 8283800: Simplify String.indexOf/lastIndexOf calls

2022-03-28 Thread Leonid Mesnik
On Sun, 20 Mar 2022 12:45:34 GMT, Andrey Turbanov wrote: > In a few places String.indexOf/lastIndexOf methods are called with default > parameter for index: `0` for `indexOf`, length() for `lastIndexOf`. > I propose to cleanup such calls. It makes code a bit easier to read. In case > of

Re: RFR: 8283800: Simplify String.indexOf/lastIndexOf calls

2022-03-28 Thread Xue-Lei Andrew Fan
On Sun, 20 Mar 2022 12:45:34 GMT, Andrey Turbanov wrote: > In a few places String.indexOf/lastIndexOf methods are called with default > parameter for index: `0` for `indexOf`, length() for `lastIndexOf`. > I propose to cleanup such calls. It makes code a bit easier to read. In case > of

Re: RFR: 8283800: Simplify String.indexOf/lastIndexOf calls

2022-03-28 Thread Brian Burkhalter
On Sun, 20 Mar 2022 12:45:34 GMT, Andrey Turbanov wrote: > In a few places String.indexOf/lastIndexOf methods are called with default > parameter for index: `0` for `indexOf`, length() for `lastIndexOf`. > I propose to cleanup such calls. It makes code a bit easier to read. In case > of

RFR: 8283800: Simplify String.indexOf/lastIndexOf calls

2022-03-28 Thread Andrey Turbanov
In a few places String.indexOf/lastIndexOf methods are called with default parameter for index: `0` for `indexOf`, length() for `lastIndexOf`. I propose to cleanup such calls. It makes code a bit easier to read. In case of `indexOf` it even could be faster, as there is separate intrinsic for