| 228 | } |
| 229 | |
| 230 | void |
| 231 | ghb_dict_copy(GhbValue *dst, const GhbValue *src) |
| 232 | { |
| 233 | GhbDictIter iter; |
| 234 | const char *key; |
| 235 | GhbValue *val, *dst_val; |
| 236 | |
| 237 | iter = ghb_dict_iter_init(src); |
| 238 | while (ghb_dict_iter_next(src, &iter, &key, &val)) |
| 239 | { |
| 240 | dst_val = ghb_dict_get(dst, key); |
| 241 | if (ghb_value_type(val) == GHB_DICT) |
| 242 | { |
| 243 | if (dst_val == NULL || ghb_value_type(dst_val) != GHB_DICT) |
| 244 | { |
| 245 | dst_val = ghb_value_dup(val); |
| 246 | ghb_dict_set(dst, key, dst_val); |
| 247 | } |
| 248 | else if (ghb_value_type(dst_val) == GHB_DICT) |
| 249 | { |
| 250 | ghb_dict_copy(dst_val, val); |
| 251 | } |
| 252 | } |
| 253 | else |
| 254 | { |
| 255 | ghb_dict_set(dst, key, ghb_value_dup(val)); |
| 256 | } |
| 257 | } |
| 258 | } |
no outgoing calls
no test coverage detected