/[pkg-firebird]/upstream/current/src/jrd/Optimizer.cpp
ViewVC logotype

Diff of /upstream/current/src/jrd/Optimizer.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 451 by dam-guest, Sat Aug 5 16:50:09 2006 UTC revision 500 by dam-guest, Fri Oct 6 20:09:51 2006 UTC
# Line 2432  bool OptimizerRetrieval::matchBoolean(In Line 2432  bool OptimizerRetrieval::matchBoolean(In
2432          return (count >= 1);          return (count >= 1);
2433  }  }
2434    
2435    namespace
2436    {
2437            class IndexScratchListHolder
2438            {
2439            public:
2440                    IndexScratchListHolder (IndexScratchList& Scratches) :
2441                            m_Scratches(Scratches) {};
2442    
2443                    ~IndexScratchListHolder()
2444                    {
2445                            clear();
2446                    }
2447    
2448                    void clear()
2449                    {
2450                            for (int i = 0; i < m_Scratches.getCount(); i++)
2451                            {
2452                                    IndexScratch* s = m_Scratches[i];
2453                                    m_Scratches[i] = 0;
2454                                    delete s;
2455                            }
2456                            m_Scratches.clear();
2457                    }
2458    
2459            private:
2460                    IndexScratchList& m_Scratches;
2461            };
2462    }       // namespace
2463    
2464  InversionCandidate* OptimizerRetrieval::matchOnIndexes(  InversionCandidate* OptimizerRetrieval::matchOnIndexes(
2465          IndexScratchList* indexScratches, jrd_nod* boolean, USHORT scope) const          IndexScratchList* indexScratches, jrd_nod* boolean, USHORT scope) const
2466  {  {
# Line 2458  InversionCandidate* OptimizerRetrieval:: Line 2487  InversionCandidate* OptimizerRetrieval::
2487    
2488                  // Make list for index matches                  // Make list for index matches
2489                  IndexScratchList indexOrScratches;                  IndexScratchList indexOrScratches;
2490                    IndexScratchListHolder scratchHolder(indexOrScratches);
2491    
2492                  // Copy information from caller                  // Copy information from caller
2493                  IndexScratch** indexScratch = indexScratches->begin();                  IndexScratch** indexScratch = indexScratches->begin();
2494                  int i = 0;                  int i = 0;
# Line 2484  InversionCandidate* OptimizerRetrieval:: Line 2515  InversionCandidate* OptimizerRetrieval::
2515                  }                  }
2516    
2517                  // Clear list to remove previously matched conjunctions                  // Clear list to remove previously matched conjunctions
2518                  indexOrScratches.clear();                  scratchHolder.clear();
2519                  // Copy information from caller                  // Copy information from caller
2520                  indexScratch = indexScratches->begin();                  indexScratch = indexScratches->begin();
2521                  i = 0;                  i = 0;

Legend:
Removed from v.451  
changed lines
  Added in v.500

  ViewVC Help
Powered by ViewVC 1.1.5