You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by GitBox <gi...@apache.org> on 2022/07/10 14:45:13 UTC

[GitHub] [pdfbox] THausherr commented on pull request #107: potential memory leaks and small performance improvements

THausherr commented on PR #107:
URL: https://github.com/apache/pdfbox/pull/107#issuecomment-1179741986

   > > existing code is better IMHO. And whoever wrote this, intended to use an array instead of a list.
   > 
   > You are converting an array to a list in the getXRefRanges method. You use more memory and time to do this. I just removed the redundant operation. You are used to using lists. Only on this occasion you say that the existing code is better.
   
   getXRefRanges() starts with a list when it calls `new ArrayList<>()`. The current code converts this to an array at the end with `return list.toArray(new Long[list.size()]);` and loses the list.


-- 
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: dev-unsubscribe@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org