diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-string.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 3f2b85d28..0808d9715 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -523,7 +523,7 @@ namespace Slang UInt IndexOf(const char * str, UInt id) const // String str { - if (id < 0 || id >= getLength()) + if (id >= getLength()) return UInt(-1); auto findRs = strstr(begin() + id, str); UInt res = findRs ? findRs - begin() : -1; @@ -612,7 +612,7 @@ namespace Slang { if (!buffer) return false; - return (IndexOf(str) >= 0) ? true : false; + return (IndexOf(str) != UInt(-1)) ? true : false; } bool Contains(const String & str) const |
