aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/pyext/repeated_composite_container.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/pyext/repeated_composite_container.cc')
-rw-r--r--python/google/protobuf/pyext/repeated_composite_container.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/google/protobuf/pyext/repeated_composite_container.cc b/python/google/protobuf/pyext/repeated_composite_container.cc
index d6bc3d7b..ca700580 100644
--- a/python/google/protobuf/pyext/repeated_composite_container.cc
+++ b/python/google/protobuf/pyext/repeated_composite_container.cc
@@ -272,8 +272,8 @@ int AssignSubscript(RepeatedCompositeContainer* self,
}
// Delete from the underlying Message, if any.
- if (self->parent != NULL) {
- if (cmessage::InternalDeleteRepeatedField(self->parent,
+ if (self->message != nullptr) {
+ if (cmessage::InternalDeleteRepeatedField(self->message,
self->parent_field_descriptor,
slice,
self->child_messages) < 0) {
@@ -486,15 +486,15 @@ static PyObject* Pop(PyObject* pself, PyObject* args) {
}
// Release field of parent message and transfer the ownership to target.
-void ReleaseLastTo(CMessage* parent,
+void ReleaseLastTo(Message* message,
const FieldDescriptor* field,
CMessage* target) {
- GOOGLE_CHECK(parent != nullptr);
+ GOOGLE_CHECK(message != nullptr);
GOOGLE_CHECK(field != nullptr);
GOOGLE_CHECK(target != nullptr);
CMessage::OwnerRef released_message(
- parent->message->GetReflection()->ReleaseLast(parent->message, field));
+ message->GetReflection()->ReleaseLast(message, field));
// TODO(tibell): Deal with proto1.
target->parent = NULL;
@@ -524,7 +524,7 @@ int Release(RepeatedCompositeContainer* self) {
for (Py_ssize_t i = size - 1; i >= 0; --i) {
CMessage* child_cmessage = reinterpret_cast<CMessage*>(
PyList_GET_ITEM(self->child_messages, i));
- ReleaseLastTo(self->parent, field, child_cmessage);
+ ReleaseLastTo(message, field, child_cmessage);
}
// Detach from containing message.