mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibRegex: Move StringTable ctor/dtor out of line
This also moves the next_serial class static into a file scope static. The public class static was causing visibility issues with certain Linux builds when hidden visibility was enabled. However, the current design makes more sense anyway :^).
This commit is contained in:
parent
8f670950e2
commit
3dd2fbd041
Notes:
github-actions[bot]
2025-05-12 09:23:38 +00:00
Author: https://github.com/ayeteadoe
Commit: 3dd2fbd041
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4667
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/alimpfard
2 changed files with 14 additions and 13 deletions
|
@ -143,19 +143,10 @@ struct CompareTypeAndValuePair {
|
|||
class OpCode;
|
||||
|
||||
struct StringTable {
|
||||
StringTable()
|
||||
: m_serial(next_serial++)
|
||||
{
|
||||
}
|
||||
StringTable();
|
||||
~StringTable();
|
||||
StringTable(StringTable const&) = default;
|
||||
StringTable(StringTable&&) = default;
|
||||
|
||||
~StringTable()
|
||||
{
|
||||
if (m_serial == next_serial - 1 && m_table.is_empty())
|
||||
--next_serial; // We didn't use this serial, put it back.
|
||||
}
|
||||
|
||||
StringTable& operator=(StringTable const&) = default;
|
||||
StringTable& operator=(StringTable&&) = default;
|
||||
|
||||
|
@ -180,7 +171,6 @@ struct StringTable {
|
|||
return m_inverse_table.get(index).value();
|
||||
}
|
||||
|
||||
static u32 next_serial;
|
||||
u32 m_serial { 0 };
|
||||
HashMap<FlyString, ByteCodeValueType> m_table;
|
||||
HashMap<ByteCodeValueType, FlyString> m_inverse_table;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue