Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well null or empty. It is done to improve readability of the code and better express intent.
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
#include "Exception.h"
|
||||
#include "Interpreter.h"
|
||||
|
||||
#include <Tools.h>
|
||||
|
||||
|
||||
namespace Base
|
||||
{
|
||||
@@ -73,7 +75,7 @@ public:
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::asObject(GetPyObject(hGrp)));
|
||||
// A Reason of null indicates to clear the parameter group
|
||||
if (Reason && Reason[0] != '\0') {
|
||||
if (!Base::Tools::isNullOrEmpty(Reason)) {
|
||||
args.setItem(1, Py::String(Reason));
|
||||
}
|
||||
method.apply(args);
|
||||
|
||||
Reference in New Issue
Block a user