extensions/source/propctrlr/propcontroller.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dbc655a1e6bdb118e09d87d1fd9022c201d7b068
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Aug 31 10:57:39 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Aug 31 18:21:56 2022 +0200

    cid#1509230 Inefficient vector resizing with reserve.
    
    preserve the benefits of reserving with the benefits of logarithmic
    doubling
    
    Change-Id: I41896d1cef3e9939fda13f055e045ccb5d6ea1ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139085
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index 624bf03d16b6..b0516fd90903 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -956,7 +956,7 @@ namespace pcr
                 }
 
                 // append these properties to our "all properties" array
-                aProperties.reserve( aProperties.size() + 
aThisHandlersProperties.size() );
+                aProperties.reserve( std::max<size_t>(aProperties.size() + 
aThisHandlersProperties.size(), aProperties.size() * 2) );
                 for (const auto & aThisHandlersProperty : 
aThisHandlersProperties)
                 {
                     auto noPrevious = std::none_of(

Reply via email to