[asterisk-bugs] [Asterisk 0011896]: [patch] Optimized update_realtime_member_field function

noreply at bugs.digium.com noreply at bugs.digium.com
Wed May 21 11:13:54 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11896 
====================================================================== 
Reported By:                atis
Assigned To:                putnopvut
====================================================================== 
Project:                    Asterisk
Issue ID:                   11896
Category:                   Applications/app_queue
Reproducibility:            N/A
Severity:                   tweak
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 101580 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             01-31-2008 17:21 CST
Last Modified:              05-21-2008 11:13 CDT
====================================================================== 
Summary:                    [patch] Optimized update_realtime_member_field
function
Description: 
Currently update_realtime_member_field does first load to find out current
uniqueid of member by interface and queue name, and only then updates
corresponding member record by uniqueid.

This can be optimized by storing uniqueid in member structure, making
update_realtime_member_field much more simpler and eliminating extra access
to realtime engine.

It won't break current systems (without uniqueid), as they are not
updating anyway.
====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 05-21-08 11:13  
---------------------------------------------------------------------- 
I gave v6 a look, and it appears to be good. The only nitpick I have is a
coding guidelines one. Typically, if it can be done, we like to not indent
large blocks if they don't need to be indented. in set_member_paused, there
is a section, if (failed), where the if portion contains a single statement
and the else portion contains a large block. If the if portion were
modified to be

if (failed) {
    /* log message omitted */
    ao2_ref(mem, -1);
    continue;
}

then the else part would not need to be inside an else block at all, and
we could lose a level of indention as a result.

Since this is such a minor detail and you have already done a lot of work
to get this patch to where it is, I will make this small change myself when
I commit it. Thanks for the contribution! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-21-08 11:13  putnopvut      Note Added: 0087113                          
======================================================================




More information about the asterisk-bugs mailing list