Commits

Anonymous committed 52a84da

itemsets: using static buffers in ::Set for performance

Comments (0)

Files changed (1)

svtools/source/items1/itemset.cxx

         return false;
     }
     bool bAllCandidatesInRange = false;
-    vector<ItemEntry> vSourceItems, vOldSoureItems;
+    static vector<ItemEntry> vSourceItems, vOldSoureItems;
     vector<ItemEntry>* pSourceItems = &vSourceItems;
     vector<ItemEntry>* pOldSourceItems = &vOldSoureItems;
     vector<ItemEntry>::iterator pCandidatesBegin;
     if(bDeep && rSet.m_pParent)
     {
         bAllCandidatesInRange = true;
-        vector<sal_uInt16> vLegalWhichRange, vOldLegalWhichRange;
+        static vector<sal_uInt16> vLegalWhichRange, vOldLegalWhichRange;
         vector<sal_uInt16>* pLegalWhichRange = &vLegalWhichRange;
         vector<sal_uInt16>* pOldLegalWhichRange = &vOldLegalWhichRange;
-        pSourceItems->reserve(128);
-        pOldSourceItems->reserve(128);
-        pLegalWhichRange->reserve(32);
-        pOldLegalWhichRange->reserve(32);
+        pLegalWhichRange->clear();
+        pSourceItems->clear();
         copy(m_vWhichRanges.begin(), m_vWhichRanges.end(), back_inserter(*pLegalWhichRange));
         for(const SfxItemSet* pCurrentSet = &rSet;
             pCurrentSet;