diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-11-24 16:05:14 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-11-29 20:00:18 +0000 |
commit | 5d35573a62686aa3b0c45fc032b79670d88ebba9 (patch) | |
tree | 7e60a301e347ba073d2d310c59083b18eeaa922f /src/qml/jsruntime/qv4dateobject.cpp | |
parent | a36d19546891a808cf71dbb084d6d63870d2b8ec (diff) |
Clean up Value::isString()/stringValue() combinations
It's enough to just call stringValue(), as that already
does the isString() check.
Change-Id: I7be0e643a7975c0704b4c9c43b337deb8db9fce0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 5af26f8f36..8cc6a25fea 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -689,8 +689,8 @@ void DateCtor::construct(const Managed *, Scope &scope, CallData *callData) } else { arg = RuntimeHelpers::toPrimitive(arg, PREFERREDTYPE_HINT); - if (arg->isString()) - t = ParseString(arg->stringValue()->toQString()); + if (String *s = arg->stringValue()) + t = ParseString(s->toQString()); else t = TimeClip(arg->toNumber()); } |