basic/string-util: make ellipsize() inline

Once the redundant check is removed, it's a very simple wrapper around
ellipsize_mem().
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-06-02 21:53:25 +02:00
parent 40352cf0c1
commit ae03775f56
2 changed files with 4 additions and 8 deletions
+4 -1
View File
@@ -156,7 +156,10 @@ static inline bool _pure_ in_charset(const char *s, const char* charset) {
bool string_has_cc(const char *p, const char *ok) _pure_;
char *ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, unsigned percent);
char *ellipsize(const char *s, size_t length, unsigned percent);
static inline char *ellipsize(const char *s, size_t length, unsigned percent) {
return ellipsize_mem(s, strlen(s), length, percent);
}
char *cellescape(char *buf, size_t len, const char *s);
/* This limit is arbitrary, enough to give some idea what the string contains */