mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
remove pointless malloc/free, should improve file load performance a
teeny bit. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9201 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
709adddc81
commit
edbd6c43c9
@ -223,7 +223,7 @@ struct entry_pdata
|
||||
Account *acc;
|
||||
};
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_string(xmlNodePtr node, GncEntry* entry,
|
||||
void (*func)(GncEntry *entry, const char *txt))
|
||||
{
|
||||
@ -235,19 +235,18 @@ set_string(xmlNodePtr node, GncEntry* entry,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_timespec(xmlNodePtr node, GncEntry* entry,
|
||||
void (*func)(GncEntry *entry, Timespec ts))
|
||||
{
|
||||
Timespec *ts = dom_tree_to_timespec (node);
|
||||
g_return_val_if_fail(ts, FALSE);
|
||||
Timespec ts = dom_tree_to_timespec (node);
|
||||
g_return_val_if_fail(is_valid_timespec(ts), FALSE);
|
||||
|
||||
func(entry, *ts);
|
||||
g_free(ts);
|
||||
func(entry, ts);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_numeric(xmlNodePtr node, GncEntry* entry,
|
||||
void (*func)(GncEntry *entry, gnc_numeric num))
|
||||
{
|
||||
@ -259,7 +258,7 @@ set_numeric(xmlNodePtr node, GncEntry* entry,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_boolean(xmlNodePtr node, GncEntry* entry,
|
||||
void (*func)(GncEntry *entry, gboolean val))
|
||||
{
|
||||
@ -271,7 +270,7 @@ set_boolean(xmlNodePtr node, GncEntry* entry,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_account(xmlNodePtr node, struct entry_pdata *pdata,
|
||||
void (*func)(GncEntry *entry, Account *acc))
|
||||
{
|
||||
@ -291,7 +290,7 @@ set_account(xmlNodePtr node, struct entry_pdata *pdata,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_taxtable (xmlNodePtr node, struct entry_pdata *pdata,
|
||||
void (*func)(GncEntry *entry, GncTaxTable *taxtable))
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ struct invoice_pdata
|
||||
GNCBook *book;
|
||||
};
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_string(xmlNodePtr node, GncInvoice* invoice,
|
||||
void (*func)(GncInvoice *invoice, const char *txt))
|
||||
{
|
||||
@ -181,20 +181,18 @@ set_string(xmlNodePtr node, GncInvoice* invoice,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_timespec(xmlNodePtr node, GncInvoice* invoice,
|
||||
void (*func)(GncInvoice *invoice, Timespec ts))
|
||||
{
|
||||
Timespec* ts = dom_tree_to_timespec(node);
|
||||
g_return_val_if_fail(ts, FALSE);
|
||||
Timespec ts = dom_tree_to_timespec(node);
|
||||
g_return_val_if_fail(is_valid_timespec(ts), FALSE);
|
||||
|
||||
func(invoice, *ts);
|
||||
|
||||
g_free(ts);
|
||||
func(invoice, ts);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
invoice_guid_handler (xmlNodePtr node, gpointer invoice_pdata)
|
||||
{
|
||||
struct invoice_pdata *pdata = invoice_pdata;
|
||||
|
@ -114,7 +114,7 @@ struct order_pdata
|
||||
GNCBook *book;
|
||||
};
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_string(xmlNodePtr node, GncOrder* order,
|
||||
void (*func)(GncOrder *order, const char *txt))
|
||||
{
|
||||
@ -127,20 +127,18 @@ set_string(xmlNodePtr node, GncOrder* order,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
set_timespec(xmlNodePtr node, GncOrder* order,
|
||||
void (*func)(GncOrder *order, Timespec ts))
|
||||
{
|
||||
Timespec* ts = dom_tree_to_timespec(node);
|
||||
g_return_val_if_fail(ts, FALSE);
|
||||
Timespec ts = dom_tree_to_timespec(node);
|
||||
g_return_val_if_fail(is_valid_timespec(ts), FALSE);
|
||||
|
||||
func(order, *ts);
|
||||
|
||||
g_free(ts);
|
||||
func(order, ts);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static inline gboolean
|
||||
order_guid_handler (xmlNodePtr node, gpointer order_pdata)
|
||||
{
|
||||
struct order_pdata *pdata = order_pdata;
|
||||
|
Loading…
Reference in New Issue
Block a user