Skip to content

Commit

Permalink
Add likeliness annotations to slice functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dcreager committed May 1, 2020
1 parent 3a727e6 commit 2ac0ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/libcork/ds/slice.h
Expand Up @@ -147,7 +147,7 @@ CORK_INLINE
int
cork_slice_slice_fast(struct cork_slice *slice, size_t offset, size_t length)
{
if (slice->iface->slice == NULL) {
if (CORK_LIKELY(slice->iface->slice == NULL)) {
slice->buf += offset;
slice->size = length;
return 0;
Expand All @@ -163,7 +163,7 @@ CORK_INLINE
int
cork_slice_slice_offset_fast(struct cork_slice *slice, size_t offset)
{
if (slice->iface->slice == NULL) {
if (CORK_LIKELY(slice->iface->slice == NULL)) {
slice->buf += offset;
slice->size -= offset;
return 0;
Expand Down

0 comments on commit 2ac0ade

Please sign in to comment.