switch from assert to if + return
This commit is contained in:
4
strops.c
4
strops.c
@ -132,7 +132,9 @@ bool_t strops_equals(const char* string1, const char* string2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool_t strops_starts_with(const char* string1, const char* string2) {
|
bool_t strops_starts_with(const char* string1, const char* string2) {
|
||||||
assert(strops_length(string1) >= strops_length(string2) && "string2 cannot be longer than string1");
|
if (strops_length(string1) < strops_length(string2)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
bool_t starts_with = 1;
|
bool_t starts_with = 1;
|
||||||
ull_t i;
|
ull_t i;
|
||||||
for (i = 0; i < strops_length(string2); i++) {
|
for (i = 0; i < strops_length(string2); i++) {
|
||||||
|
Reference in New Issue
Block a user