1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Style tweaks

This commit is contained in:
Eelco Dolstra 2022-05-25 12:32:22 +02:00
parent ba035f7dd0
commit 91b7d5373a
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
9 changed files with 165 additions and 370 deletions

View file

@ -131,11 +131,11 @@ public:
bool debugStop;
bool debugQuit;
std::list<DebugTrace> debugTraces;
std::map<const Expr*, const std::shared_ptr<const StaticEnv> > exprEnvs;
const std::shared_ptr<const StaticEnv> getStaticEnv(const Expr &expr) const
std::map<const Expr*, const std::shared_ptr<const StaticEnv>> exprEnvs;
const std::shared_ptr<const StaticEnv> getStaticEnv(const Expr & expr) const
{
auto i = exprEnvs.find(&expr);
if (i != exprEnvs.end())
if (i != exprEnvs.end())
return i->second;
else
return std::shared_ptr<const StaticEnv>();;
@ -145,7 +145,7 @@ public:
template<class E>
[[gnu::noinline, gnu::noreturn]]
void debugThrow(const E &error, const Env & env, const Expr & expr)
void debugThrow(E && error, const Env & env, const Expr & expr)
{
if (debugRepl)
runDebugRepl(&error, env, expr);
@ -155,7 +155,7 @@ public:
template<class E>
[[gnu::noinline, gnu::noreturn]]
void debugThrowLastTrace(E & e)
void debugThrowLastTrace(E && e)
{
// Call this in the situation where Expr and Env are inaccessible.
// The debugger will start in the last context that's in the