1 //------------------------------------------------------------------------------
2 // GB_mx_same: check if two arrays are equal
3 //------------------------------------------------------------------------------
4 
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7 
8 //------------------------------------------------------------------------------
9 
10 #include "GB_mex.h"
11 
GB_mx_same(char * X,char * Y,int64_t len)12 bool GB_mx_same     // true if arrays X and Y are the same
13 (
14     char *X,
15     char *Y,
16     int64_t len     // length of X and Y
17 )
18 {
19     if (X == Y) return (true) ;
20     if (X == NULL) return (false) ;
21     if (Y == NULL) return (false) ;
22     for (int64_t i = 0 ; i < len ; i++)
23     {
24         if (X [i] != Y [i]) return (false) ;
25     }
26     return (true) ;
27 }
28 
29