<p>Max has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11865">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Don't traverse empty lists in llist_count()<br><br>While trying to debug odd crash in queue_limit_to(), I've checked<br>llist_count() as a possible culprit. Not sure if it would fix the<br>crash (unable to reproduce locally yet) but it seems like a meaningful<br>optimization anyway.<br><br>Change-Id: I1e2ede2dd1afbd9e7ed7e393f9ba244179c03b8c<br>---<br>M include/osmocom/core/linuxlist.h<br>1 file changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/65/11865/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h</span><br><span>index 8d0533f..27bd85a 100644</span><br><span>--- a/include/osmocom/core/linuxlist.h</span><br><span>+++ b/include/osmocom/core/linuxlist.h</span><br><span>@@ -391,6 +391,10 @@</span><br><span> {</span><br><span>    struct llist_head *entry;</span><br><span>    unsigned int i = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (llist_empty(head))</span><br><span style="color: hsl(120, 100%, 40%);">+                return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  llist_for_each(entry, head)</span><br><span>          i++;</span><br><span>         return i;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11865">change 11865</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/11865"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I1e2ede2dd1afbd9e7ed7e393f9ba244179c03b8c </div>
<div style="display:none"> Gerrit-Change-Number: 11865 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>