Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloprobst committed Sep 10, 2024
1 parent 8981dad commit 429d96f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions hyperon_das_atomdb_cpp/src/adapters/ram_only.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ const shared_ptr<const Node> InMemoryDB::add_node(const NodeParams& node_params)
auto node = this->_build_node(node_params);
this->db.node[node->handle] = node;
this->_update_index(*node);
return node;
return move(node);
}

//------------------------------------------------------------------------------
const shared_ptr<const Link> InMemoryDB::add_link(const LinkParams& link_params, bool toplevel) {
auto link = this->_build_link(link_params, toplevel);
this->db.link[link->handle] = link;
this->_update_index(*link);
return link;
return move(link);
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -367,7 +367,7 @@ void InMemoryDB::commit() { throw runtime_error("Not implemented"); }
const shared_ptr<const Atom> InMemoryDB::_get_atom(const string& handle) const {
auto node = this->_get_node(handle);
if (node) {
return node;
return move(node);
}
return this->_get_link(handle);
}
Expand Down Expand Up @@ -396,7 +396,7 @@ const shared_ptr<const Link> InMemoryDB::_get_and_delete_link(const string& link
if (it != this->db.link.end()) {
auto link_document = make_shared<Link>(*it->second);
this->db.link.erase(it);
return link_document;
return move(link_document);
}
return nullptr;
}
Expand Down Expand Up @@ -448,7 +448,7 @@ void InMemoryDB::_add_atom_type(const string& atom_type_name, const string& atom
StringList composite_type = {TYPEDEF_MARK_HASH, type_hash, base_type_hash};
string composite_type_hash = ExpressionHasher::composite_hash(composite_type);
auto new_atom_type = make_shared<AtomType>(key, key, composite_type_hash, atom_type_name, name_hash);
this->db.atom_type[key] = new_atom_type;
this->db.atom_type[key] = move(new_atom_type);
this->named_type_table[name_hash] = atom_type_name;
}

Expand Down
4 changes: 2 additions & 2 deletions hyperon_das_atomdb_cpp/src/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const shared_ptr<const Atom> AtomDB::get_atom(const string& handle, const Params
throw AtomDoesNotExist("Nonexistent atom", "handle: " + handle);
}
if (params.get<bool>(ParamsKeys::NO_TARGET_FORMAT).value_or(false)) {
return document;
return move(document);
}
return _reformat_document(document, params);
}
Expand Down Expand Up @@ -134,5 +134,5 @@ shared_ptr<Link> AtomDB::_build_link(const LinkParams& link_params, bool is_top_
n++;
}

return link;
return move(link);
}

0 comments on commit 429d96f

Please sign in to comment.