diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-23 10:50:59 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-23 10:50:59 (GMT) |
commit | 9f3dfcd9982cff90cf0466413d17fc1061c43f00 (patch) | |
tree | e29d0f70ecdfb742e3bbbc522e87281c8bbd58e7 /src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore | |
parent | 216e8efb0f1aff9afd3881ab89b49e017e255228 (diff) | |
download | uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.zip uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.tar.gz uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.tar.bz2 |
Fixed the 100% CPU utilization bug and replaced the bool() cast operator for data by empty()
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index a064394..a6909b5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -222,7 +222,7 @@ void JSCDataModel::setEvent(const Event& event) { } else if (event.content.length() > 0) { // _event.data is a string or JSON Data json = Data::fromJSON(event.content); - if (json) { + if (!json.empty()) { JSStringRef propName = JSStringCreateWithUTF8CString("data"); JSObjectSetProperty(_ctx, eventObj, propName, getDataAsValue(json), 0, &exception); JSStringRelease(propName); @@ -255,7 +255,7 @@ void JSCDataModel::setEvent(const Event& event) { nameListIter++; } } - if (eventCopy.data > 0) { + if (!eventCopy.data.empty()) { JSStringRef propName = JSStringCreateWithUTF8CString("data"); JSObjectSetProperty(_ctx, eventObj, propName, getDataAsValue(eventCopy.data), 0, &exception); JSStringRelease(propName); |