<p><b>@smlng</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11634#discussion_r290694135">sys/tsrb/tsrb.c</a>:</p>
<pre style='color:#555'>>  {
     rb->buf[rb->writes++ & (rb->size - 1)] = c;
 }
 
-static char _pop(tsrb_t *rb)
+static uint8_t _pop(tsrb_t *rb)
 {
     return rb->buf[rb->reads++ & (rb->size - 1)];
 }
 
 int tsrb_get_one(tsrb_t *rb)
</pre>
<p>why is it less efficient? Its simpler and (more over) type safe:</p>
<pre><code>uint8_t tsrb_get_one(tsrb_t *rb)
{
    return _pop(rb);
}
</code></pre>
<p>and upon usage (like in isrpipe or so)</p>
<pre><code>uint8_t c;
if (!tsrb_empty(rb)) {
    c = tsrb_get_one(rb);
}
else {
    DEBUG("ring buffer empty!\n");
    /* do error handling if required */
}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11634?email_source=notifications&email_token=ABE7WYA7QYDUXLAQXECLZ53PY6QBJA5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2UOJQQ#discussion_r290694135">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYEO43HJWXXJD5PHW5LPY6QBJANCNFSM4HTU3XKA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYCOIG42CAOCZ2RAIYLPY6QBJA5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2UOJQQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11634?email_source=notifications\u0026email_token=ABE7WYA7QYDUXLAQXECLZ53PY6QBJA5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2UOJQQ#discussion_r290694135",
"url": "https://github.com/RIOT-OS/RIOT/pull/11634?email_source=notifications\u0026email_token=ABE7WYA7QYDUXLAQXECLZ53PY6QBJA5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2UOJQQ#discussion_r290694135",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>