Removing nested function through macro use.
This commit is contained in:
parent
cb16a49e78
commit
8aed349139
@ -37,6 +37,14 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "knowledge.h"
|
#include "knowledge.h"
|
||||||
|
|
||||||
|
#define erode(deltaw) { \
|
||||||
|
if (smode & 1) \
|
||||||
|
{ \
|
||||||
|
w = w + (deltaw); \
|
||||||
|
} \
|
||||||
|
smode = smode / 2; \
|
||||||
|
}
|
||||||
|
|
||||||
//! Trivial goal detection
|
//! Trivial goal detection
|
||||||
/**
|
/**
|
||||||
* Detect goals that we do not need to solve because they can be trivially solved.
|
* Detect goals that we do not need to solve because they can be trivially solved.
|
||||||
@ -352,15 +360,6 @@ computeGoalWeight (const System sys, const Binding b)
|
|||||||
int smode;
|
int smode;
|
||||||
Term t;
|
Term t;
|
||||||
|
|
||||||
void erode (const float deltaw)
|
|
||||||
{
|
|
||||||
if (smode & 1)
|
|
||||||
{
|
|
||||||
w = w + deltaw;
|
|
||||||
}
|
|
||||||
smode = smode / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Total weight
|
// Total weight
|
||||||
w = 0;
|
w = 0;
|
||||||
// We will shift this mode variable
|
// We will shift this mode variable
|
||||||
|
Loading…
Reference in New Issue
Block a user