Open johannessen opened 4 days ago
I was thinking maybe there should be a const char * const
with the empty string. neo4j_ustring_value()
could then simply return that pointer for a zero-length string. Checking the string length would have a slight overhead though.
According to the documentation,
neo4j_ustring_value()
always returns a valid pointer for a string.https://majensen.github.io/libneo4j-omni/neo4j-client-doxy.html#_CPPv419neo4j_ustring_value13neo4j_value_t
However, for zero-length strings, no memory is allocated for the
ustring
field upon deserialisation. As a consequence,neo4j_ustring_value()
returns a null pointer.https://github.com/majensen/libneo4j-omni/blob/1151ada0fd8aa507d2e736a82074449f52df42ed/lib/src/deserialization.c#L664-L679