some refactorings

This commit is contained in:
2022-01-02 12:45:53 +01:00
parent d3a373ce94
commit ebb69b6096
10 changed files with 57 additions and 54 deletions

View File

@@ -134,7 +134,7 @@ std::string string_padd(const std::string &str, size_t pad_len, char fill_char,
}
std::string string_substring(const std::string & str, long pos, long count) {
std::string string_substring(const std::string & str, long pos, size_t count) {
size_t start_pos = pos;
if (pos < 0) {
@@ -155,5 +155,5 @@ size_t string_find_substr(const std::string & str, const std::string & pattern,
size_t p = str.find(pattern, pos);
return p != str.npos ? p : -1;
return p != std::string::npos ? p : -1;
}