Skip to content

Commit

Permalink
Update JSON subproject reference and refactor pointer usage for impro…
Browse files Browse the repository at this point in the history
…ved safety
  • Loading branch information
riccardodebenedictis committed Jan 27, 2025
1 parent e072e84 commit faa73e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extern/json
Submodule json updated 1 files
+1 −1 extern/utils
2 changes: 1 addition & 1 deletion src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace riddle
p->atoms.push_back(atm);
q.pop();
for (auto &parent : p->parents)
q.push(parent.operator->());
q.push(&*parent);
}
return atm;
}
Expand Down
2 changes: 1 addition & 1 deletion src/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace riddle
}
q.pop();
for (auto &parent : p->get_parents())
q.push(parent.operator->());
q.push(&*parent);
}

auto atm = scp.get_core().new_atom(is_fact, pred, std::move(c_args));
Expand Down
12 changes: 6 additions & 6 deletions src/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace riddle
if (tp == this)
return true;
for (const auto &e : tp->get_enums())
q.push(e.operator->());
q.push(&*e);
}
}
return false;
Expand Down Expand Up @@ -94,7 +94,7 @@ namespace riddle
if (tp == this)
return true;
for (const auto &p : tp->parents)
q.push(p.operator->());
q.push(&*p);
}
}
return false;
Expand Down Expand Up @@ -247,7 +247,7 @@ namespace riddle
q.pop();
tp->created_predicate(*predicates[name]);
for (const auto &p : tp->parents)
q.push(p.operator->());
q.push(&*p);
}
}

Expand All @@ -272,7 +272,7 @@ namespace riddle
q.pop();
tp->instances.push_back(utils::s_ptr(itm));
for (const auto &p : tp->parents)
q.push(p.operator->());
q.push(&*p);
}
return itm;
}
Expand All @@ -294,7 +294,7 @@ namespace riddle
if (tp == this)
return true;
for (const auto &p : tp->parents)
q.push(p.operator->());
q.push(&*p);
}
}
return false;
Expand Down Expand Up @@ -322,7 +322,7 @@ namespace riddle
q.pop();
p->atoms.push_back(atm);
for (const auto &par : p->parents)
q.push(par.operator->());
q.push(&*par);
}
return atm;
}
Expand Down

0 comments on commit faa73e8

Please sign in to comment.