summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-28 16:32:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-29 09:33:14 +0100
commited79bc866bf5fee5037ceb55f582d10807244164 (patch)
tree5a9759e0f8308aa4af8257edfeceb3d706c03cc6 /include
parente8032897b4a012d8e236211ee6e5ce89fb90492e (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/svl/nfkeytab.hxx26
1 files changed, 2 insertions, 24 deletions
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