MCPcopy Create free account
hub / github.com/numpy/numpy / PyArray_CompareString

Function PyArray_CompareString

numpy/core/src/multiarray/arrayobject.c:582–595  ·  view source on GitHub ↗

NUMPY_API */

Source from the content-addressed store, hash-verified

580/*NUMPY_API
581 */
582NPY_NO_EXPORT int
583PyArray_CompareString(const char *s1, const char *s2, size_t len)
584{
585 const unsigned char *c1 = (unsigned char *)s1;
586 const unsigned char *c2 = (unsigned char *)s2;
587 size_t i;
588
589 for(i = 0; i < len; ++i) {
590 if (c1[i] != c2[i]) {
591 return (c1[i] > c2[i]) ? 1 : -1;
592 }
593 }
594 return 0;
595}
596
597
598/* Call this from contexts where an array might be written to, but we have no

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected