aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLString.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-01-08 15:36:28 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-08 21:28:11 +0000
commit2c33e3e3f40ebcde0bfa6d22cc34b6b97526fb36 (patch)
treee54a5e2fa1e05a940cedbf898ebb59a39c95c967 /src/sksl/SkSLString.cpp
parentc5980d0aa3e97f07a4f5bc413a2c5bc5ed3bc973 (diff)
fixed inconsistent ordering of SkSL enums
Bug: skia: Change-Id: Ifa11117f804ee2dd233d4a2a0241e567aecc5307 Reviewed-on: https://skia-review.googlesource.com/92103 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLString.cpp')
-rw-r--r--src/sksl/SkSLString.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sksl/SkSLString.cpp b/src/sksl/SkSLString.cpp
index c9242d398e..7581e0cf3c 100644
--- a/src/sksl/SkSLString.cpp
+++ b/src/sksl/SkSLString.cpp
@@ -165,6 +165,14 @@ bool StringFragment::operator!=(const char* s) const {
return 0 != s[fLength];
}
+bool StringFragment::operator<(StringFragment other) const {
+ int comparison = strncmp(fChars, other.fChars, std::min(fLength, other.fLength));
+ if (comparison) {
+ return comparison < 0;
+ }
+ return fLength < other.fLength;
+}
+
bool operator==(const char* s1, StringFragment s2) {
return s2 == s1;
}