diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-08-11 20:37:54 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-08-11 20:37:54 +0100 |
commit | 1e57387c1390e09b6a66de98011897ddd229236f (patch) | |
tree | b0dadfb3851a8f512df9f99b435662d14b0240b7 | |
parent | Use simplified XmlDocumentSerializer interface (diff) | |
download | gentoobrowse-api-1e57387c1390e09b6a66de98011897ddd229236f.tar.bz2 gentoobrowse-api-1e57387c1390e09b6a66de98011897ddd229236f.tar.xz gentoobrowse-api-1e57387c1390e09b6a66de98011897ddd229236f.zip |
Use stringstream str by move
-rw-r--r-- | gentoobrowse-api/domain/converters.impl.h | 2 | ||||
-rw-r--r-- | gentoobrowse-api/service/xsltStreamSerializer.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gentoobrowse-api/domain/converters.impl.h b/gentoobrowse-api/domain/converters.impl.h index 38a674e..ebff336 100644 --- a/gentoobrowse-api/domain/converters.impl.h +++ b/gentoobrowse-api/domain/converters.impl.h @@ -68,6 +68,6 @@ namespace Slicer { } } ss << "}"; - return ss.str(); + return std::move(ss).str(); } } diff --git a/gentoobrowse-api/service/xsltStreamSerializer.cpp b/gentoobrowse-api/service/xsltStreamSerializer.cpp index acb5750..9d453ac 100644 --- a/gentoobrowse-api/service/xsltStreamSerializer.cpp +++ b/gentoobrowse-api/service/xsltStreamSerializer.cpp @@ -62,7 +62,7 @@ namespace Gentoo { xmlOutputBufferClose(buf); return std::make_shared<MultiPart>(Headers {}, "related", Parts { - std::make_shared<TextPart>(Headers {}, "text/html", strm.str()), + std::make_shared<TextPart>(Headers {}, "text/html", std::move(strm).str()), std::make_shared<TextPart>( Headers { {"Content-Id", "<style.css@gentoobrowse.randomdan.homeip.net>"}, @@ -74,7 +74,6 @@ namespace Gentoo { IceTray::Mime::BasicPartPtr XsltStreamSerializer::getText(xmlDoc * result) { - std::stringstream strm; std::vector<std::string> callLynx { "/usr/bin/lynx", "-dump", @@ -88,6 +87,7 @@ namespace Gentoo { fclose(lynxIn); std::array<char, BUFSIZ> buf {}; ssize_t r; + std::stringstream strm; while ((r = read(fds.fdOut(), buf.data(), buf.size())) > 0) { strm.write(buf.data(), r); } @@ -96,6 +96,6 @@ namespace Gentoo { if (status != 0) { throw std::runtime_error("Lynx failed"); } - return std::make_shared<TextPart>(Headers {}, "text/plain", strm.str()); + return std::make_shared<TextPart>(Headers {}, "text/plain", std::move(strm).str()); } } |