diff options
Diffstat (limited to 'libnetdata/string/string.c')
-rw-r--r-- | libnetdata/string/string.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libnetdata/string/string.c b/libnetdata/string/string.c index 4e232523c8..9385aa6e8d 100644 --- a/libnetdata/string/string.c +++ b/libnetdata/string/string.c @@ -300,16 +300,20 @@ void string_freez(STRING *string) { string_stats_atomic_increment(releases); } -size_t string_strlen(STRING *string) { +inline size_t string_strlen(STRING *string) { if(unlikely(!string)) return 0; return string->length - 1; } -const char *string2str(STRING *string) { +inline const char *string2str(STRING *string) { if(unlikely(!string)) return ""; return string->str; } +int string_strcmp(STRING *string, const char *s) { + return strcmp(string2str(string), s); +} + STRING *string_2way_merge(STRING *a, STRING *b) { static STRING *X = NULL; |