RFR: 8294293: Remove unused _width and _newlines field in outputStream [v2]

David Holmes dholmes at openjdk.org
Wed Sep 28 01:50:40 UTC 2022


On Mon, 26 Sep 2022 08:44:44 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> 1. `_width` is unused so I deleted it
>> 2. `_newlines` was used in one place, and only to check if any new lines had been seen. I removed `_newlines` and instead used `update_position`'s unused return value to indicate whether any newlines has been seen. This required expanding the call of `xmlTextStream::write` in `defaultStream`.
>> 
>> This removes some cruft from `outputStream` and saves us 8 bytes on the size of `outputStream`.
>> 
>> I also noted that `_position` isn't number of chars into a line, but rather a "visual position". It's a bit surprising, which is why I added this comment. This can be seen in the `\t` case in `update_position`.
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove include

Okay this seems reasonable.

Thanks.

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10411


More information about the hotspot-dev mailing list