mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:03:23 +00:00
Core: don't inline rarely used function
This is only used by one caller and there doesn't appear to be a reason to inline it in the first place. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
543cefa61e
commit
826c01d0a0
2 changed files with 15 additions and 15 deletions
|
@ -28,6 +28,21 @@ bool is_subsurface_cloud = false;
|
|||
|
||||
int (*update_progress_cb)(const char *) = NULL;
|
||||
|
||||
static bool includes_string_caseinsensitive(const char *haystack, const char *needle)
|
||||
{
|
||||
if (!needle)
|
||||
return 1; /* every string includes the NULL string */
|
||||
if (!haystack)
|
||||
return 0; /* nothing is included in the NULL string */
|
||||
int len = strlen(needle);
|
||||
while (*haystack) {
|
||||
if (strncasecmp(haystack, needle, len))
|
||||
return 1;
|
||||
haystack++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void set_git_update_cb(int(*cb)(const char *))
|
||||
{
|
||||
update_progress_cb = cb;
|
||||
|
|
|
@ -45,21 +45,6 @@ static inline bool empty_string(const char *s)
|
|||
return !s || !*s;
|
||||
}
|
||||
|
||||
static inline bool includes_string_caseinsensitive(const char *haystack, const char *needle)
|
||||
{
|
||||
if (!needle)
|
||||
return 1; /* every string includes the NULL string */
|
||||
if (!haystack)
|
||||
return 0; /* nothing is included in the NULL string */
|
||||
int len = strlen(needle);
|
||||
while (*haystack) {
|
||||
if (strncasecmp(haystack, needle, len))
|
||||
return 1;
|
||||
haystack++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline char *copy_string(const char *s)
|
||||
{
|
||||
return (s && *s) ? strdup(s) : NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue