1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 11:36:03 +01:00

makeRegexCache(): Return a ref

This commit is contained in:
Eelco Dolstra 2025-10-27 14:11:59 +01:00
parent 1f6ac88efc
commit fdc5600fa7
2 changed files with 5 additions and 4 deletions

View file

@ -191,7 +191,7 @@ std::ostream & operator<<(std::ostream & os, const ValueType t);
struct RegexCache; struct RegexCache;
std::shared_ptr<RegexCache> makeRegexCache(); ref<RegexCache> makeRegexCache();
struct DebugTrace struct DebugTrace
{ {
@ -372,6 +372,7 @@ public:
const fetchers::Settings & fetchSettings; const fetchers::Settings & fetchSettings;
const EvalSettings & settings; const EvalSettings & settings;
SymbolTable symbols; SymbolTable symbols;
PosTable positions; PosTable positions;
@ -504,7 +505,7 @@ private:
/** /**
* Cache used by prim_match(). * Cache used by prim_match().
*/ */
std::shared_ptr<RegexCache> regexCache; const ref<RegexCache> regexCache;
public: public:

View file

@ -4611,9 +4611,9 @@ struct RegexCache
} }
}; };
std::shared_ptr<RegexCache> makeRegexCache() ref<RegexCache> makeRegexCache()
{ {
return std::make_shared<RegexCache>(); return make_ref<RegexCache>();
} }
void prim_match(EvalState & state, const PosIdx pos, Value ** args, Value & v) void prim_match(EvalState & state, const PosIdx pos, Value ** args, Value & v)