MarkDacek edited a comment on issue #362: Add a check to StringUtils.repeat() 
for large length repeat value
URL: https://github.com/apache/commons-lang/pull/362#issuecomment-447725344
 
 
   > > I'm somewhat wary of simply comparing the values, as it's not always 
intuitive and doesn't save us much in the way of performance. Perhaps comparing 
it to Integer.MAX_VALUE is a bit more appropriate?
   > 
   > What do you mean?
   
   
https://github.com/apache/commons-lang/pull/362/files#diff-3f4c835875ddc8a211c0272e8be51394R6253
   
   I would sooner do something like:
   
   `final long longSize = (long) inputLength *  repeat;`
   `if(longSize > Integer.MAX_VALUE)`
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to