diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-03-05 17:03:11 +0100 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-03-05 19:54:31 +0100 |
commit | a865d423974ea06dffa47798c81e98e7570b02ec (patch) | |
tree | d25f6c86d2948f7d8683aaa573d24135c8a26edb /indra/newview/llcommandlineparser.cpp | |
parent | 043a92997f187826ad26ff269613c8f0ed11379f (diff) |
viewer#819 Avoid reading the same XML file multiple times
Diffstat (limited to 'indra/newview/llcommandlineparser.cpp')
-rw-r--r-- | indra/newview/llcommandlineparser.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index bc61fac00b..030d24bed8 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -657,12 +657,11 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG // This method reads the llsd based config file, and uses it to set // members of a control group. LLSD clpConfigLLSD; - - llifstream input_stream; - input_stream.open(config_filename.c_str(), std::ios::in | std::ios::binary); - if(input_stream.is_open()) + std::string xml = gDirUtilp->getFileContents(config_filename); + if (!xml.empty()) { + std::stringstream input_stream(xml); LLSDSerialize::fromXML(clpConfigLLSD, input_stream); for(LLSD::map_iterator option_itr = clpConfigLLSD.beginMap(); option_itr != clpConfigLLSD.endMap(); |