@@ -26,23 +26,16 @@ int intPow(int x, int p)
26
26
27
27
QString col_to_name (int col_num)
28
28
{
29
- static thread_local QMap<int , QString> col_cache;
30
-
31
- auto it = col_cache.find (col_num);
32
- if (it == col_cache.end ()) {
33
- QString col_str;
34
- int remainder ;
35
- while (col_num) {
36
- remainder = col_num % 26 ;
37
- if (remainder == 0 )
38
- remainder = 26 ;
39
- col_str.prepend (QChar (' A' + remainder - 1 ));
40
- col_num = (col_num - 1 ) / 26 ;
41
- }
42
- it = col_cache.insert (col_num, col_str);
29
+ QString col_str;
30
+ int remainder ;
31
+ while (col_num) {
32
+ remainder = col_num % 26 ;
33
+ if (remainder == 0 )
34
+ remainder = 26 ;
35
+ col_str.prepend (QChar (' A' + remainder - 1 ));
36
+ col_num = (col_num - 1 ) / 26 ;
43
37
}
44
-
45
- return it.value ();
38
+ return col_str;
46
39
}
47
40
48
41
int col_from_name (const QString &col_str)
@@ -104,7 +97,7 @@ CellReference::CellReference(const char *cell)
104
97
105
98
void CellReference::init (const QString &cell_str)
106
99
{
107
- static thread_local QRegularExpression re (QStringLiteral (" ^\\ $?([A-Z]{1,3})\\ $?(\\ d+)$" ));
100
+ static const QRegularExpression re (QStringLiteral (" ^\\ $?([A-Z]{1,3})\\ $?(\\ d+)$" ));
108
101
QRegularExpressionMatch match = re.match (cell_str);
109
102
if (match.hasMatch ()) {
110
103
const QString col_str = match.captured (1 );
@@ -138,7 +131,7 @@ CellReference::~CellReference()
138
131
QString CellReference::toString (bool row_abs, bool col_abs) const
139
132
{
140
133
if (!isValid ())
141
- return QString () ;
134
+ return {} ;
142
135
143
136
QString cell_str;
144
137
if (col_abs)
0 commit comments