}
else if (att1->attbyval)
{
- switch (att1->attlen)
- {
- case 1:
- if (GET_1_BYTE(values1[i1]) !=
- GET_1_BYTE(values2[i2]))
- {
- cmpresult = (GET_1_BYTE(values1[i1]) <
- GET_1_BYTE(values2[i2])) ? -1 : 1;
- }
- break;
- case 2:
- if (GET_2_BYTES(values1[i1]) !=
- GET_2_BYTES(values2[i2]))
- {
- cmpresult = (GET_2_BYTES(values1[i1]) <
- GET_2_BYTES(values2[i2])) ? -1 : 1;
- }
- break;
- case 4:
- if (GET_4_BYTES(values1[i1]) !=
- GET_4_BYTES(values2[i2]))
- {
- cmpresult = (GET_4_BYTES(values1[i1]) <
- GET_4_BYTES(values2[i2])) ? -1 : 1;
- }
- break;
-#if SIZEOF_DATUM == 8
- case 8:
- if (GET_8_BYTES(values1[i1]) !=
- GET_8_BYTES(values2[i2]))
- {
- cmpresult = (GET_8_BYTES(values1[i1]) <
- GET_8_BYTES(values2[i2])) ? -1 : 1;
- }
- break;
-#endif
- default:
- Assert(false); /* cannot happen */
- }
+ if (values1[i1] != values2[i2])
+ cmpresult = (values1[i1] < values2[i2]) ? -1 : 1;
}
else
{
}
else if (att1->attbyval)
{
- switch (att1->attlen)
- {
- case 1:
- result = (GET_1_BYTE(values1[i1]) ==
- GET_1_BYTE(values2[i2]));
- break;
- case 2:
- result = (GET_2_BYTES(values1[i1]) ==
- GET_2_BYTES(values2[i2]));
- break;
- case 4:
- result = (GET_4_BYTES(values1[i1]) ==
- GET_4_BYTES(values2[i2]));
- break;
-#if SIZEOF_DATUM == 8
- case 8:
- result = (GET_8_BYTES(values1[i1]) ==
- GET_8_BYTES(values2[i2]));
- break;
-#endif
- default:
- Assert(false); /* cannot happen */
- }
+ result = (values1[i1] == values2[i2]);
}
else
{