pjfanning opened a new pull request, #1360:
URL: https://github.com/apache/poi/pull/1360
Indexed `getXxxArray(i)` and `sizeOfXxxArray()` calls on xmlbeans objects
each walk the element's children, so loops of the form
```java
for (int i = 0; i < x.sizeOfFooArray(); i++) {
CTFoo foo = x.getFooArray(i);
```
are quadratic. This changes the loops in poi-ooxml main code to call
`getFooArray()` once and iterate the array.
Covered: `XPathHelper`, `XWPFNumbering`, `XWPFParagraph`,
`ExternalLinksTable`, `XSSFOptimiser`, `XSSFRichTextString`, `XSSFSheet` (table
removal), `XSSFSimpleShape`, `XDDFChart` (series and axes), `XSLFTextShape`,
`XSLFTextParagraph`, `XSLFPictureShape`.
The loops that modify the list only remove one element and then return or
break straight away, so using an array snapshot is safe.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]