Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander.A,Utkin committed Dec 5, 2024
1 parent 794eb5f commit ab66015
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pyreindexer/lib/src/rawpyreindexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ PyObject* itemModify(PyObject* self, PyObject* args, ItemModifyMode mode) {

Py_DECREF(itemDefDict);

char* json = const_cast<char*>(wrSer.c_str());
err = item.Unsafe().FromJSON(json, 0, mode == ModeDelete);
err = item.Unsafe().FromJSON(wrSer.c_str(), 0, mode == ModeDelete);
if (!err.ok()) {
Py_XDECREF(preceptsList);

Expand All @@ -317,7 +316,7 @@ PyObject* itemModify(PyObject* self, PyObject* args, ItemModifyMode mode) {
return pyErr(err);
}

item.SetPrecepts(itemPrecepts);
item.SetPrecepts(itemPrecepts); // ToDo after migrate on v.4, do std::move
}

Py_XDECREF(preceptsList);
Expand Down Expand Up @@ -545,8 +544,7 @@ PyObject* modifyTransaction(PyObject* self, PyObject* args, ItemModifyMode mode)

Py_DECREF(defDict);

char* json = const_cast<char*>(wrSer.c_str());
err = item.Unsafe().FromJSON(json, 0, mode == ModeDelete);
err = item.Unsafe().FromJSON(wrSer.c_str(), 0, mode == ModeDelete);
if (!err.ok()) {
Py_XDECREF(precepts);

Expand All @@ -564,7 +562,7 @@ PyObject* modifyTransaction(PyObject* self, PyObject* args, ItemModifyMode mode)
return pyErr(err);
}

item.SetPrecepts(itemPrecepts);
item.SetPrecepts(itemPrecepts); // ToDo after migrate on v.4, do std::move
}

Py_XDECREF(precepts);
Expand Down Expand Up @@ -594,7 +592,6 @@ static PyObject* CommitTransaction(PyObject* self, PyObject* args) {
return nullptr;
}

assert((StopTransactionMode::Commit == stopMode) || (StopTransactionMode::Rollback == stopMode));
size_t count = 0;
auto err = getWrapper<TransactionWrapper>(transactionWrapperAddr)->Commit(count);

Expand All @@ -609,7 +606,6 @@ static PyObject* RollbackTransaction(PyObject* self, PyObject* args) {
return nullptr;
}

assert((StopTransactionMode::Commit == stopMode) || (StopTransactionMode::Rollback == stopMode));
auto err = getWrapper<TransactionWrapper>(transactionWrapperAddr)->Rollback();

deleteWrapper<TransactionWrapper>(transactionWrapperAddr);
Expand Down

0 comments on commit ab66015

Please sign in to comment.