MCPcopy Create free account
hub / github.com/apache/impala / DictionaryDoubleDecode

Function DictionaryDoubleDecode

be/src/gutil/strings/serialize.cc:310–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308
309
310bool DictionaryDoubleDecode(unordered_map<string, double>* dictionary,
311 const string& encoded_str) {
312 vector<pair<string, string> > items;
313 if (!DictionaryParse(encoded_str, &items))
314 return false;
315
316 dictionary->clear();
317 for (const auto& item : items) {
318 char *error = nullptr;
319 const double value = strtod(item.second.c_str(), &error);
320 if (error == item.second.c_str() || *error != '\0') {
321 // parsing error
322 return false;
323 }
324 (*dictionary)[item.first] = value;
325 }
326 return true;
327}

Callers

nothing calls this directly

Calls 2

DictionaryParseFunction · 0.85
clearMethod · 0.65

Tested by

no test coverage detected