Commit 6375a00
bisect: simplify string_list memory handling
We declare the refs_for_removal string_list as NODUP, forcing us to
manually allocate strings we insert. And then when it comes time to
clean up, we set strdup_strings so that string_list_clear() will free
them for us.
This is a confusing pattern, and can be done much more simply by just
declaring the list with the DUP initializer in the first place.
It was written this way originally because one of the callsites
generated the item using xstrfmt(). But that spot switched to a plain
xstrdup() in the preceding commit. That means we can now just let the
string_list code handle allocation itself.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 9e86e1a commit 6375a00
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
1183 | | - | |
1184 | | - | |
| 1183 | + | |
1185 | 1184 | | |
1186 | 1185 | | |
1187 | 1186 | | |
| |||
1190 | 1189 | | |
1191 | 1190 | | |
1192 | 1191 | | |
1193 | | - | |
| 1192 | + | |
1194 | 1193 | | |
1195 | 1194 | | |
1196 | 1195 | | |
1197 | | - | |
1198 | | - | |
| 1196 | + | |
| 1197 | + | |
1199 | 1198 | | |
1200 | 1199 | | |
1201 | 1200 | | |
1202 | | - | |
1203 | 1201 | | |
1204 | 1202 | | |
1205 | 1203 | | |
| |||
0 commit comments