From 3370ea39fa730ec22e4a2f5496729543c96cc98b Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 4 Dec 2025 13:17:48 +1100 Subject: Feature [feature-requests:#1564]. Use vector to store FoldMaps as map is not nothrow default constructable. --- win32/ScintillaWin.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index f426c8c46..5f3258a5f 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2848,14 +2848,16 @@ void CreateFoldMap(int codePage, FoldMap *foldingMap) { class CaseFolderDBCS : public CaseFolderTable { // Allocate the expandable storage here so that it does not need to be reallocated // for each call to Fold. - const FoldMap *foldingMap; - UINT cp; + const FoldMap *foldingMap = nullptr; + UINT cp = 0; public: explicit CaseFolderDBCS(UINT cp_) : cp(cp_) { - if (!DBCSHasFoldMap(cp)) { - CreateFoldMap(cp, DBCSGetMutableFoldMap(cp)); - } foldingMap = DBCSGetFoldMap(cp); + if (!foldingMap) { + FoldMap *pfm = DBCSCreateFoldMap(cp); + CreateFoldMap(cp, pfm); + foldingMap = pfm; + } } size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override; }; -- cgit v1.2.3