Skip to content

Commit 10c1d07

Browse files
authored
Merge pull request #43 from StochasticTree/rfx_serialization_update
Updated deserialization for random effects in C++
2 parents e99b1e5 + 88c48f8 commit 10c1d07

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/random_effects.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ void LabelMapper::from_json(const nlohmann::json& rfx_label_mapper_json) {
3232
int num_values = rfx_label_mapper_json.at("values").size();
3333
CHECK_EQ(num_keys, num_values);
3434
for (int i = 0; i < num_keys; i++) {
35-
keys_.push_back(rfx_label_mapper_json.at("keys").at(i));
36-
label_map_.insert({rfx_label_mapper_json.at("keys").at(i), rfx_label_mapper_json.at("values").at(i)});
35+
int32_t key = rfx_label_mapper_json.at("keys").at(i);
36+
int32_t value = rfx_label_mapper_json.at("values").at(i);
37+
keys_.push_back(key);
38+
label_map_.insert({key, value});
3739
}
3840
}
3941

0 commit comments

Comments
 (0)