Commit 8e71548
xdiff: reduce the size of array
When the myers algorithm is selected the input files are pre-processed
to remove any common prefix and suffix and any lines that appear
in only one file. This requires a map to be created between the
lines that are processed by the myers algorithm and the lines in
the original file. That map does not include the common lines at the
beginning and end of the files but the array is allocated to be the
size of the whole file. Move the allocation into xdl_cleanup_records()
where the map is populated and we know how big it needs to be.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 4525684 commit 8e71548
1 file changed
Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 174 | | |
181 | 175 | | |
182 | 176 | | |
| |||
283 | 277 | | |
284 | 278 | | |
285 | 279 | | |
286 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
287 | 284 | | |
288 | 285 | | |
289 | 286 | | |
| |||
0 commit comments