* Makes a deep clone of a dictionary * and its elements. * * @returns a copy of the dictionary. */
| 231 | * @returns a copy of the dictionary. |
| 232 | */ |
| 233 | Object::Ptr Dictionary::Clone() const |
| 234 | { |
| 235 | DictionaryData dict; |
| 236 | |
| 237 | { |
| 238 | std::shared_lock<std::shared_timed_mutex> lock (m_DataMutex); |
| 239 | |
| 240 | dict.reserve(GetLength()); |
| 241 | |
| 242 | for (const Dictionary::Pair& kv : m_Data) { |
| 243 | dict.emplace_back(kv.first, kv.second.Clone()); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | return new Dictionary(std::move(dict)); |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * Returns an ordered vector containing all keys |
nothing calls this directly
no outgoing calls
no test coverage detected