<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14676">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vector.h: Add AST_VECTOR_SORT()<br><br>Allows a vector to be sorted in-place, rather than only during<br>insertion.<br><br>Change-Id: I22cba9ddf556a7e44dacc53c4431bd81dd2fa780<br>---<br>M include/asterisk/vector.h<br>1 file changed, 10 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/vector.h b/include/asterisk/vector.h</span><br><span>index 291cdf4..8f5cf8c 100644</span><br><span>--- a/include/asterisk/vector.h</span><br><span>+++ b/include/asterisk/vector.h</span><br><span>@@ -388,6 +388,16 @@</span><br><span> })</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(120, 100%, 40%);">+ * \brief Sort a vector in-place</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param vec Vector to sort</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param cmp A memcmp compatible compare function</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+#define AST_VECTOR_SORT(vec, cmp) ({ \</span><br><span style="color: hsl(120, 100%, 40%);">+      qsort((vec)->elems, (vec)->current, sizeof(typeof((vec)->elems[0])), cmp); \</span><br><span style="color: hsl(120, 100%, 40%);">+})</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*!</span><br><span>  * \brief Remove an element from a vector by index.</span><br><span>  *</span><br><span>  * Note that elements in the vector may be reordered, so that the remove can</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14676">change 14676</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14676"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I22cba9ddf556a7e44dacc53c4431bd81dd2fa780 </div>
<div style="display:none"> Gerrit-Change-Number: 14676 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>