}
EINA_MAGIC_SET(buf, EINA_MAGIC_STRBUF);
- if (!_eina_strbuf_init(buf))
+ if (EINA_UNLIKELY(!_eina_strbuf_init(buf)))
{
eina_strbuf_free(buf);
return NULL;
EINA_MAGIC_CHECK_STRBUF(buf, EINA_FALSE);
len = strlen(str);
- if (!_eina_strbuf_grow(buf, buf->len + len))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, buf->len + len)))
return EINA_FALSE;
memcpy(buf->buf + buf->len, str, len + 1);
buf->len += len;
if (EINA_UNLIKELY(!esc))
return EINA_FALSE;
len = strlen(esc);
- if (!_eina_strbuf_grow(buf, buf->len + len))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, buf->len + len)))
return EINA_FALSE;
memcpy(buf->buf + buf->len, esc, len + 1);
buf->len += len;
len = strlen(str);
if (len > maxlen) len = maxlen;
- if (!_eina_strbuf_grow(buf, buf->len + len))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, buf->len + len)))
return EINA_FALSE;
memcpy(buf->buf + buf->len, str, len);
* resize the buffer if necessary
*/
len = strlen(str);
- if (!_eina_strbuf_grow(buf, buf->len + len))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, buf->len + len)))
return EINA_FALSE;
/* move the existing text */
memmove(buf->buf + len + pos, buf->buf + pos, buf->len - pos);
{
EINA_MAGIC_CHECK_STRBUF(buf, EINA_FALSE);
- if (!_eina_strbuf_grow(buf, buf->len + 1))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, buf->len + 1)))
return EINA_FALSE;
buf->buf[(buf->len)++] = c;
buf->buf[buf->len] = '\0';
if (len1 != len2)
{
/* resize the buffer if necessary */
- if (!_eina_strbuf_grow(buf, buf->len - len1 + len2))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, buf->len - len1 + len2)))
return EINA_FALSE;
/* move the existing text */
memmove(buf->buf + pos + len2, buf->buf + pos + len1,
n++;
len = (len + len2) - len1;
/* resize the buffer if necessary */
- if (!_eina_strbuf_grow(buf, len))
+ if (EINA_UNLIKELY(!_eina_strbuf_grow(buf, len)))
{
/* we have to stop replacing here, because we haven't enough
* memory to go on */