* Internal helper to compare floatvectors */
| 665 | * Internal helper to compare floatvectors |
| 666 | */ |
| 667 | static int floatvector_cmp_internal(FloatVector *a, FloatVector *b) |
| 668 | { |
| 669 | int dim = Min(a->dim, b->dim); |
| 670 | for (int16 i = 0, imax = dim; i < imax; ++i) { |
| 671 | if (a->x[i] < b->x[i]) { |
| 672 | return -1; |
| 673 | } |
| 674 | if (a->x[i] > b->x[i]) { |
| 675 | return 1; |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | if (a->dim < b->dim) { |
| 680 | return -1; |
| 681 | } |
| 682 | |
| 683 | if (a->dim > b->dim) { |
| 684 | return 1; |
| 685 | } |
| 686 | |
| 687 | return 0; |
| 688 | } |
| 689 | |
| 690 | PG_FUNCTION_INFO_V1(floatvector_lt); |
| 691 | Datum floatvector_lt(PG_FUNCTION_ARGS) |
no test coverage detected