Skip to content

Commit 8e3653e

Browse files
fixed empty() call
1 parent 03a2749 commit 8e3653e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/call.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Value call(const char *name, Params&&... params)
4646
*/
4747
inline Value array_keys(const Value &value) { return call("array_keys", value); }
4848
inline Value array_values(const Value &value) { return call("array_values", value); }
49-
inline Value empty(const Value &value) { return call("empty", value); }
49+
inline Value empty(const Value &value) { return value.isNull() || !value.boolValue(); }
5050
inline Value empty(const HashMember<std::string> &member) { return !member.exists() || empty(member.value()); }
5151
inline Value empty(const HashMember<int> &member) { return !member.exists() || empty(member.value()); }
5252
//inline Value isset(const Value &value) { return call("isset", value); }

0 commit comments

Comments
 (0)