MCPcopy Create free account
hub / github.com/documentdb/documentdb / StringViewEquals

Function StringViewEquals

pg_documentdb_core/include/utils/string_view.h:114–129  ·  view source on GitHub ↗

* Validates if two string views are equal (based on length and contents). * Does an ordinal comparison of characters. */

Source from the content-addressed store, hash-verified

112 * Does an ordinal comparison of characters.
113 */
114inline static bool
115StringViewEquals(const StringView *left, const StringView *right)
116{
117 if (left == NULL && right == NULL)
118 {
119 return true;
120 }
121
122 if ((left == NULL) ^ (right == NULL))
123 {
124 return false;
125 }
126
127 return left->length == right->length &&
128 strncmp(left->string, right->string, left->length) == 0;
129}
130
131
132/*

Calls

no outgoing calls

Tested by

no test coverage detected