mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-02-02 10:40:38 +01:00
Code simplification
This commit is contained in:
parent
f57eb26b62
commit
12fc195093
@ -541,13 +541,8 @@ namespace
|
|||||||
NestConst<ValueExprNode>* to_ptr = to_clause->expressions.begin();
|
NestConst<ValueExprNode>* to_ptr = to_clause->expressions.begin();
|
||||||
for (const auto to_end = to_ptr + count; to_ptr != to_end; ++to_ptr)
|
for (const auto to_end = to_ptr + count; to_ptr != to_end; ++to_ptr)
|
||||||
{
|
{
|
||||||
const auto fromField = nodeAs<FieldNode>(*from_ptr);
|
|
||||||
const auto toField = nodeAs<FieldNode>(*to_ptr);
|
|
||||||
|
|
||||||
if ((map && mapEqual(*to_ptr, *from_ptr, map)) ||
|
if ((map && mapEqual(*to_ptr, *from_ptr, map)) ||
|
||||||
(!map && fromField && toField &&
|
(!map && fieldEqual(*to_ptr, *from_ptr)))
|
||||||
fromField->fieldStream == toField->fieldStream &&
|
|
||||||
fromField->fieldId == toField->fieldId))
|
|
||||||
{
|
{
|
||||||
ValueExprNode* swap = *to_swap;
|
ValueExprNode* swap = *to_swap;
|
||||||
*to_swap = *to_ptr;
|
*to_swap = *to_ptr;
|
||||||
@ -1646,12 +1641,10 @@ void Optimizer::checkSorts()
|
|||||||
bool equal = true;
|
bool equal = true;
|
||||||
for (unsigned i = 0; i < sortCount; i++)
|
for (unsigned i = 0; i < sortCount; i++)
|
||||||
{
|
{
|
||||||
const auto sortField = nodeAs<FieldNode>(sort->expressions[i]);
|
const auto sortNode = sort->expressions[i];
|
||||||
const auto projectField = nodeAs<FieldNode>(project->expressions[i]);
|
const auto projectNode = project->expressions[i];
|
||||||
|
|
||||||
if (!sortField || !projectField ||
|
if (!fieldEqual(sortNode, projectNode))
|
||||||
sortField->fieldStream != projectField->fieldStream ||
|
|
||||||
sortField->fieldId != projectField->fieldId)
|
|
||||||
{
|
{
|
||||||
equal = false;
|
equal = false;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user