CompareArray compare array values, the main purpose of this comparsion is for equal comparison larger/less comparision may not be accurate
(dataType DataType, a, b unsafe.Pointer)
| 124 | // CompareArray compare array values, the main purpose of this comparsion is for equal comparison |
| 125 | // larger/less comparision may not be accurate |
| 126 | func CompareArray(dataType DataType, a, b unsafe.Pointer) int { |
| 127 | len1 := int(*(*uint32)(a)) |
| 128 | len2 := int(*(*uint32)(b)) |
| 129 | if len1 != len2 { |
| 130 | return len1 - len2 |
| 131 | } |
| 132 | if len1 == 0 { |
| 133 | return 0 |
| 134 | } |
| 135 | bytes := CalculateListElementBytes(dataType, len1) |
| 136 | // skip 4 bytes for length |
| 137 | return utils.MemCmp(a, b, 4, bytes) |
| 138 | } |
| 139 | |
| 140 | // ArrayLengthCompare compare |
| 141 | func ArrayLengthCompare(v1, v2 *DataValue) int { |
no test coverage detected