string: remove unnecessary refcount update

Passing the argument to a pure function is
essentially a "borrow", and the caller has had to
make sure the refcount doesn't drop to zero anyway
This commit is contained in:
anna 2021-07-15 14:16:06 +02:00
parent 5aed426864
commit b011d5feb5
Signed by: fef
GPG key ID: EC22E476DC2D3D84

View file

@ -48,7 +48,6 @@ string *leftpad(const string *s, usize len, nchar fillchr, error *err)
return 0;
}
nget(s);
string *padded;
if (len < s->_len) {
@ -60,7 +59,6 @@ string *leftpad(const string *s, usize len, nchar fillchr, error *err)
padded = leftpad_unsafe(s, len, fillchr, err);
}
nput(s);
return padded;
}