From 7400b03e679d7144bdae9b5acf05c1e2fce697c8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 6 Aug 2018 13:53:19 +0200 Subject: Minor cleanup Rename bool String::compare(const String *other) to the slightly more self-explaining bool String::lessThan(const String *other) as the returned boolean value does not relate to equality. Change-Id: Ia7b1a7f47beca0659fb199c0c9d49951468ad03d Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4runtime.cpp | 8 ++++---- src/qml/jsruntime/qv4string_p.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index d82eebd1d2..11f06d9ed1 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -979,7 +979,7 @@ QV4::Bool Runtime::method_compareGreaterThan(const Value &l, const Value &r) Q_UNIMPLEMENTED(); return false; #else - return sr->compare(sl); + return sr->lessThan(sl); #endif } @@ -1016,7 +1016,7 @@ QV4::Bool Runtime::method_compareLessThan(const Value &l, const Value &r) Q_UNIMPLEMENTED(); return false; #else - return sl->compare(sr); + return sl->lessThan(sr); #endif } @@ -1053,7 +1053,7 @@ QV4::Bool Runtime::method_compareGreaterEqual(const Value &l, const Value &r) Q_UNIMPLEMENTED(); return false; #else - return !sl->compare(sr); + return !sl->lessThan(sr); #endif } @@ -1090,7 +1090,7 @@ QV4::Bool Runtime::method_compareLessEqual(const Value &l, const Value &r) Q_UNIMPLEMENTED(); return false; #else - return !sr->compare(sl); + return !sr->lessThan(sl); #endif } diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index aacc9d03a2..6a69c830ea 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -206,7 +206,7 @@ struct Q_QML_PRIVATE_EXPORT String : public StringOrSymbol { return d()->isEqualTo(other->d()); } - inline bool compare(const String *other) { + inline bool lessThan(const String *other) { return toQString() < other->toQString(); } -- cgit v1.2.3