MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / compare

Method compare

include/stringzilla/stringzilla.hpp:1990–1990  ·  view source on GitHub ↗

* @brief Compares two strings lexicographically. If prefix matches, lengths are compared. * @return 0 if equal, negative if `*this` is less than `other`, positive if `*this` is greater than `other`. */

Source from the content-addressed store, hash-verified

1988 * @return 0 if equal, negative if `*this` is less than `other`, positive if `*this` is greater than `other`.
1989 */
1990 int compare(string_view other) const noexcept { return (int)sz_order(data(), size(), other.data(), other.size()); }
1991
1992 /**
1993 * @brief Compares two strings lexicographically. If prefix matches, lengths are compared.

Callers

nothing calls this directly

Calls 5

sz_orderFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
compareMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected