include/svl/nfkeytab.hxx |   26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

New commits:
commit ed79bc866bf5fee5037ceb55f582d10807244164
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jan 28 16:32:12 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Jan 29 09:33:14 2022 +0100

    std::vector -> std::array for NfKeywordTable
    
    slightly faster to use std::array when we have a fixed size table
    
    Change-Id: I2080c18e6e550b10d521247c3734251ecace49fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129107
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svl/nfkeytab.hxx b/include/svl/nfkeytab.hxx
index 3b8140498128..3ab012f39c8f 100644
--- a/include/svl/nfkeytab.hxx
+++ b/include/svl/nfkeytab.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_SVL_NFKEYTAB_HXX
 #define INCLUDED_SVL_NFKEYTAB_HXX
 
-#include <vector>
+#include <array>
 #include <rtl/ustring.hxx>
 
 //! For ImpSvNumberformatScan: first the short symbols, then the long symbols!
@@ -95,29 +95,7 @@ enum NfKeywordIndex
     NF_KEYWORD_ENTRIES_COUNT
 };
 
-class NfKeywordTable final
-{
-    typedef ::std::vector<OUString> Keywords_t;
-    Keywords_t m_keywords;
-
-public:
-    NfKeywordTable() : m_keywords(NF_KEYWORD_ENTRIES_COUNT) {};
-    NfKeywordTable( const std::initializer_list<OUString> & l ) : m_keywords(l)
-    {
-        assert(m_keywords.size() == NF_KEYWORD_ENTRIES_COUNT);
-    }
-
-    OUString & operator[] (Keywords_t::size_type n) { return m_keywords[n]; }
-    const OUString & operator[] (Keywords_t::size_type n) const { return 
m_keywords[n]; }
-
-    Keywords_t::size_type size() const { return m_keywords.size(); }
-
-    NfKeywordTable& operator=( const NfKeywordTable& r )
-    {
-        m_keywords = r.m_keywords;
-        return *this;
-    }
-};
+typedef ::std::array<OUString, NF_KEYWORD_ENTRIES_COUNT> NfKeywordTable;
 
 #endif // INCLUDED_SVL_NFKEYTAB_HXX
 

Reply via email to