diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-04 16:27:50 -0400 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-04 16:27:50 -0400 |
| commit | 98d2f27ec7c1039679da5c86e4d1dfb308d0fc6f (patch) | |
| tree | 81ab0bcd5b77cd7a5628c0afc7c19809ee628f74 /source/core/slang-string.h | |
| parent | a7dd782d7895e1f277573fb9923be653ab813941 (diff) | |
gcc warning fix
Diffstat (limited to 'source/core/slang-string.h')
| -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 |
