Commit bec3bd4
committed
Cache LineString.getCoordinates() to avoid redundant array copies
addStartEndCoordinatesToLineString and removeStartEndCoordinatesFromLineString
called lineString.getCoordinates() 3-4 times each per invocation. Each call
copies the internal PackedCoordinateSequence to a new Coordinate[], creating
redundant garbage. Cache the result in a local variable and use System.arraycopy.1 parent ca1efb2 commit bec3bd4
1 file changed
Lines changed: 10 additions & 12 deletions
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
| |||
0 commit comments