This commit is contained in:
Kartik K. Agaram 2016-06-17 17:14:15 -07:00
parent 1e76d01d4a
commit 3c163ef7bd
2 changed files with 4 additions and 4 deletions

View File

@ -292,18 +292,18 @@ void write_memory(reagent/*copy*/ x, const vector<double>& data, const int /*onl
:(code)
int size_of(const reagent& r) {
if (r.type == NULL) return 0;
if (!r.type) return 0;
// End size_of(reagent r) Cases
return size_of(r.type);
}
int size_of(const type_tree* type) {
if (type == NULL) return 0;
if (!type) return 0;
// End size_of(type) Cases
return 1;
}
bool size_mismatch(const reagent& x, const vector<double>& data) {
if (x.type == NULL) return true;
if (!x.type) return true;
// End size_mismatch(x) Cases
//? if (size_of(x) != SIZE(data)) cerr << size_of(x) << " vs " << SIZE(data) << '\n';
return size_of(x) != SIZE(data);

View File

@ -507,7 +507,7 @@ void test_replace_middle_type_ingredient_with_multiple3() {
bool has_nth_type(const type_tree* base, int n) {
assert(n >= 0);
if (base == NULL) return false;
if (!base) return false;
if (n == 0) return true;
return has_nth_type(base->right, n-1);
}