STYLE: use spanstream instead of stringstream in more places

- particularly useful in these combinations:

  1.
      OCharStream buf;
      // populate

      ISpanStream is(buf.view());
      // parse

  2.
      // read from file
      ifile.getLine(str);

      ISpanStream is(str);
      // parse

  These avoid making a copy of the character content, compared to
  versions with stringstream:

      OStringStream buf;
      IStringStream is(buf.str());
This commit is contained in:
Mark Olesen
2024-02-29 16:04:56 +01:00
parent f6825c7952
commit 5680ce1ee2
16 changed files with 111 additions and 66 deletions

View File

@ -99,9 +99,11 @@ int main(int argc, char *argv[])
// Temporary hack to splice the specie composition data into the thermo file
// pending complete integration into the thermodynamics structure
OStringStream os;
OCharStream os;
cr.speciesThermo().write(os);
dictionary thermoDict(IStringStream(os.str())());
ISpanStream is(os.view());
dictionary thermoDict(is);
// Add elements
for (entry& dEntry : thermoDict)