Disable creating a date string to maybe use in a PINFO message.

Creating a date string occupied nearly all of the time required to
set a date on a transaction, generally to no benefit at all.
This commit is contained in:
John Ralls 2017-08-20 21:31:07 +02:00
parent 1e0a9a0ef8
commit f7ce8bcbb3

View File

@ -1933,6 +1933,8 @@ xaccTransSetDateInternal(Transaction *trans, Timespec *dadate, Timespec val)
{
xaccTransBeginEdit(trans);
#if 0 /* gnc_ctime is expensive so change to 1 only if you need to debug setting
* dates. */
{
time64 secs = (time64) val.tv_sec;
gchar *tstr = gnc_ctime (&secs);
@ -1940,7 +1942,7 @@ xaccTransSetDateInternal(Transaction *trans, Timespec *dadate, Timespec val)
trans, val.tv_sec, val.tv_nsec, tstr ? tstr : "(null)");
g_free(tstr);
}
#endif
*dadate = val;
qof_instance_set_dirty(QOF_INSTANCE(trans));
mark_trans(trans);