Re: [cp-patches] FYI: Fix for PR34991
Hi, -draw(new Polygon(xPoints, yPoints, nPoints)); +for (int i = 1; i nPoints; i++) + draw(new Line2D.Double(xPoints[i - 1], yPoints[i - 1], + xPoints[i], yPoints[i])); Hi Robert, Line2D instances are mutable (via setLine() methods) so you could save some garbage here by creating one Line2D instance and reusing it within the loop... There's even a class to help with that: gnu.java.awt.java2d.ShapeCache. Forget it. This doesn't make sense... /Roman -- http://kennke.org/blog/ signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: [cp-patches] FYI: Fix for PR34991
Hi, thanks for the hint I will rework it that way. Regards Robert David Gilbert schrieb: Robert Schuster wrote: -draw(new Polygon(xPoints, yPoints, nPoints)); +for (int i = 1; i nPoints; i++) + draw(new Line2D.Double(xPoints[i - 1], yPoints[i - 1], + xPoints[i], yPoints[i])); Hi Robert, Line2D instances are mutable (via setLine() methods) so you could save some garbage here by creating one Line2D instance and reusing it within the loop... Regards, Dave Gilbert http://www.jfree.org/ signature.asc Description: OpenPGP digital signature
Re: [cp-patches] FYI: Fix for PR34991
Robert Schuster wrote: -draw(new Polygon(xPoints, yPoints, nPoints)); +for (int i = 1; i nPoints; i++) + draw(new Line2D.Double(xPoints[i - 1], yPoints[i - 1], + xPoints[i], yPoints[i])); Hi Robert, Line2D instances are mutable (via setLine() methods) so you could save some garbage here by creating one Line2D instance and reusing it within the loop... Regards, Dave Gilbert http://www.jfree.org/