From 0895718ad1cb2bee5acddc0bdf5b582e292d50dd Mon Sep 17 00:00:00 2001 From: dimitr Date: Thu, 22 Mar 2012 07:55:12 +0000 Subject: [PATCH] Slightly changed the logic to make it easier to understand. --- src/jrd/cvt2.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/jrd/cvt2.cpp b/src/jrd/cvt2.cpp index 2ecfda1ade..abe7264cc0 100644 --- a/src/jrd/cvt2.cpp +++ b/src/jrd/cvt2.cpp @@ -130,16 +130,15 @@ bool CVT2_get_binary_comparable_desc(dsc* result, const dsc* arg1, const dsc* ar return false; } - result->makeText(MAX(arg1->getStringLength(), arg2->getStringLength()), arg1->getTextType()); - if (arg1->dsc_dtype == arg2->dsc_dtype) { - result->dsc_dtype = arg1->dsc_dtype; - - if (result->dsc_dtype == dtype_cstring) - result->dsc_length += sizeof(UCHAR); - else if (result->dsc_dtype == dtype_varying) - result->dsc_length += sizeof(USHORT); + *result = *arg1; + result->dsc_length = MAX(arg1->dsc_length, arg2->dsc_length); + } + else + { + result->makeText(MAX(arg1->getStringLength(), arg2->getStringLength()), + arg1->getTextType()); } } else if (arg1->dsc_dtype == arg2->dsc_dtype && arg1->dsc_scale == arg2->dsc_scale)