mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
pg_restore cleanups
. remove unnecessary oid_string list stuff
. use pg_get_line_buf() instead of open-coding it
. cleaner parsing of map.dat lines
Reverts 2b69afbe50 add new list type simple_oid_string_list to fe-utils/simple_list
Author: Álvaro Herrera <alvherre@kurilemu.de>
Author: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/202504141220.343fmoxfsbj4@alvherre.pgsql
This commit is contained in:
@@ -192,44 +192,3 @@ simple_ptr_list_destroy(SimplePtrList *list)
|
||||
cell = next;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add to an oid_string list
|
||||
*/
|
||||
void
|
||||
simple_oid_string_list_append(SimpleOidStringList *list, Oid oid, const char *str)
|
||||
{
|
||||
SimpleOidStringListCell *cell;
|
||||
|
||||
cell = (SimpleOidStringListCell *)
|
||||
pg_malloc(offsetof(SimpleOidStringListCell, str) + strlen(str) + 1);
|
||||
|
||||
cell->next = NULL;
|
||||
cell->oid = oid;
|
||||
strcpy(cell->str, str);
|
||||
|
||||
if (list->tail)
|
||||
list->tail->next = cell;
|
||||
else
|
||||
list->head = cell;
|
||||
list->tail = cell;
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroy an oid_string list
|
||||
*/
|
||||
void
|
||||
simple_oid_string_list_destroy(SimpleOidStringList *list)
|
||||
{
|
||||
SimpleOidStringListCell *cell;
|
||||
|
||||
cell = list->head;
|
||||
while (cell != NULL)
|
||||
{
|
||||
SimpleOidStringListCell *next;
|
||||
|
||||
next = cell->next;
|
||||
pg_free(cell);
|
||||
cell = next;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user