FW: Sqlbox performance patch

"Rene Kluwen" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Sorry, forgot to copy the list.

I changed it to the following:

                /* convert validity & deferred back to minutes */
                if (save_mt && msg->sms.validity != SMS_PARAM_UNDEFINED)
                    msg->sms.validity = (msg->sms.validity - time(NULL))/60;
                if (save_mt && msg->sms.deferred != SMS_PARAM_UNDEFINED)
                    msg->sms.deferred = (msg->sms.deferred - time(NULL))/60;
                gwlist_produce(save_list, msg);

to keep readability to a maximum. Difference is one Boolean compare extra in
my version.

== Rene

-----Original Message-----
From: Rinor Hoxha [mailto:[email protected]] 
Sent: zondag 11 augustus 2013 18:50
To: Rene Kluwen
Cc: [email protected]
Subject: Re: Sqlbox performance patch

Also on static void sql_list(Boxc *boxc), perform /* convert validity &
deferred back to minutes */ only if save_mt == 1 ,(as you do in sql_single),
otherwise spare some unnecessary calculations.

if (save_mt) {
/* convert validity & deferred back to minutes */ if (msg->sms.validity !=
SMS_PARAM_UNDEFINED)
    msg->sms.validity = (msg->sms.validity - time(NULL))/60; if
(msg->sms.deferred != SMS_PARAM_UNDEFINED)
    msg->sms.deferred = (msg->sms.deferred - time(NULL))/60; }

Br, Rinor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.