Integrated: 8294293: Remove unused _width and _newlines field in outputStream
Johan Sjölen
jsjolen at openjdk.org
Fri Sep 30 14:48:50 UTC 2022
On Fri, 23 Sep 2022 15:59:39 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`.
This pull request has now been integrated.
Changeset: 052a9249
Author: Johan Sjölen <jsjolen at openjdk.org>
Committer: Coleen Phillimore <coleenp at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/052a924985c9a095c5b45bfdc139b451bb41158e
Stats: 25 lines in 2 files changed: 3 ins; 8 del; 14 mod
8294293: Remove unused _width and _newlines field in outputStream
Reviewed-by: rehn, dholmes
-------------
PR: https://git.openjdk.org/jdk/pull/10411
More information about the hotspot-dev
mailing list