Commit 2e2bbb9
am: simplify allocations in get_commit_info()
After we call split_ident_line(), we have several begin/end
pairs for various parts of the ident. We then copy each into
a strbuf to create a single string, and then detach that
string. We can instead skip the strbuf entirely and just
duplicate the strings directly.
This is shorter, and it makes it more obvious that we are
not leaking the strbuf (we were not before, because every
code path either died or hit a strbuf_detach).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent f131db9 commit 2e2bbb9
1 file changed
Lines changed: 10 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1376 | 1376 | | |
1377 | 1377 | | |
1378 | 1378 | | |
1379 | | - | |
| 1379 | + | |
1380 | 1380 | | |
1381 | 1381 | | |
1382 | | - | |
1383 | 1382 | | |
1384 | 1383 | | |
1385 | 1384 | | |
1386 | 1385 | | |
1387 | 1386 | | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
| 1387 | + | |
| 1388 | + | |
1392 | 1389 | | |
1393 | 1390 | | |
1394 | 1391 | | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1398 | 1395 | | |
1399 | 1396 | | |
1400 | 1397 | | |
1401 | 1398 | | |
1402 | 1399 | | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1406 | 1403 | | |
1407 | 1404 | | |
1408 | 1405 | | |
1409 | | - | |
1410 | | - | |
1411 | 1406 | | |
1412 | | - | |
| 1407 | + | |
1413 | 1408 | | |
1414 | 1409 | | |
1415 | 1410 | | |
| |||
0 commit comments