From: Claudio V. C. <ro...@us...> - 2009-06-28 10:29:41
|
Build Version : T2.5.0.24418 Firebird 2.5 Beta 1 (writeBuildNum.sh,v 1.24582 2009/06/28 10:29:37 robocop Exp ) Update of /cvsroot/firebird/firebird2/src/jrd In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4887/src/jrd Modified Files: opt.cpp Optimizer.cpp Log Message: Style. Index: opt.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/opt.cpp,v retrieving revision 1.350 retrieving revision 1.351 diff -b -U3 -r1.350 -r1.351 --- opt.cpp 27 Jun 2009 06:23:24 -0000 1.350 +++ opt.cpp 28 Jun 2009 10:29:35 -0000 1.351 @@ -7901,7 +7901,6 @@ } index_desc* selected_idx = NULL; - USHORT i, j; Firebird::Array<index_desc> idx_sort(*JRD_get_thread_data()->getDefaultPool(), csb_tail->csb_indices); bool same_selectivity = false; @@ -7911,11 +7910,11 @@ if (csb_tail->csb_idx && (csb_tail->csb_indices > 1)) { - for (j = 0; j < csb_tail->csb_indices; j++) + for (USHORT j = 0; j < csb_tail->csb_indices; j++) { float selectivity = 1; // Maximum selectivity is 1 (when all keys are the same) index_desc* idx = csb_tail->csb_idx->items; - for (i = 0; i < csb_tail->csb_indices; i++) + for (USHORT i = 0; i < csb_tail->csb_indices; i++) { // Prefer ASC indices in the case of almost the same selectivities if (selectivity > idx->idx_selectivity) { @@ -7937,7 +7936,7 @@ if ((!selected_idx) || (selected_idx->idx_runtime_flags & idx_marker)) { idx = csb_tail->csb_idx->items; - for (i = 0; i < csb_tail->csb_indices; i++) + for (USHORT i = 0; i < csb_tail->csb_indices; i++) { if (!(idx->idx_runtime_flags & idx_marker)) { @@ -7953,7 +7952,7 @@ // Finally store the right order in cbs_tail->csb_idx index_desc* idx = csb_tail->csb_idx->items; - for (j = 0; j < csb_tail->csb_indices; j++) + for (USHORT j = 0; j < csb_tail->csb_indices; j++) { idx->idx_runtime_flags &= ~idx_marker; memcpy(idx, &idx_sort[j], sizeof(index_desc)); Index: Optimizer.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/Optimizer.cpp,v retrieving revision 1.113 retrieving revision 1.114 diff -b -U3 -r1.113 -r1.114 --- Optimizer.cpp 19 Jun 2009 11:33:10 -0000 1.113 +++ Optimizer.cpp 28 Jun 2009 10:29:36 -0000 1.114 @@ -2619,13 +2619,14 @@ invCandidate->dependencies = invCandidate1->dependencies + invCandidate2->dependencies; // Add matches conjunctions that exists in both left and right inversion - if ((invCandidate1->matches.getCount()) && (invCandidate2->matches.getCount())) { + if ((invCandidate1->matches.getCount()) && (invCandidate2->matches.getCount())) + { Firebird::SortedArray<jrd_nod*> matches; - size_t j; - for (j = 0; j < invCandidate1->matches.getCount(); j++) { + for (size_t j = 0; j < invCandidate1->matches.getCount(); j++) { matches.add(invCandidate1->matches[j]); } - for (j = 0; j < invCandidate2->matches.getCount(); j++) { + for (size_t j = 0; j < invCandidate2->matches.getCount(); j++) + { if (matches.exist(invCandidate2->matches[j])) { invCandidate->matches.add(invCandidate2->matches[j]); } @@ -3252,8 +3253,7 @@ // state after each test. Firebird::HalfStaticArray<bool, OPT_STATIC_ITEMS> streamFlags(pool); streamFlags.grow(innerStreams.getCount()); - size_t i; - for (i = 0; i < streamFlags.getCount(); i++) { + for (size_t i = 0; i < streamFlags.getCount(); i++) { streamFlags[i] = innerStreams[i]->used; } @@ -3303,8 +3303,7 @@ if (!done && !plan) { // Add these relations to the processing list - size_t j = 0; - for (j = 0; j < stream->indexedRelationships.getCount(); j++) + for (size_t j = 0; j < stream->indexedRelationships.getCount(); j++) { IndexRelationship* relationship = stream->indexedRelationships[j]; InnerJoinStreamInfo* relationStreamInfo = getStreamInfo(relationship->stream); @@ -3340,7 +3339,7 @@ } IndexRelationship** nextRelationship = processList->begin(); - for (j = 0; j < processList->getCount(); j++) { + for (size_t j = 0; j < processList->getCount(); j++) { InnerJoinStreamInfo* relationStreamInfo = getStreamInfo(nextRelationship[j]->stream); if (!relationStreamInfo->used) { findBestOrder(position, relationStreamInfo, processList, new_cost, new_cardinality); @@ -3364,7 +3363,7 @@ // Clean up from any changes made for compute the cost for this stream csb->csb_rpt[stream->stream].csb_flags &= ~csb_active; - for (i = 0; i < streamFlags.getCount(); i++) { + for (size_t i = 0; i < streamFlags.getCount(); i++) { innerStreams[i]->used = streamFlags[i]; } } |