Add a comment about default constructed reference counts=

Change-Id: Ia6b8a75144755d9bcf05c893bb97a1e207da6b0f
This commit is contained in:
Keir Mierle
2017-09-25 13:09:41 -07:00
parent 600262e8f8
commit 4bea6d7a2d
+3
View File
@@ -340,6 +340,9 @@ ResidualBlock* ProblemImpl::AddResidualBlock(
}
if (options_.cost_function_ownership == TAKE_OWNERSHIP) {
// Increment the reference count, creating an entry in the table if
// needed. Note: C++ maps guarantee that new entries have default
// constructed values; this implies integers are zero initialized.
++cost_function_ref_count_[cost_function];
}