Skip to content

Commit 96849b6

Browse files
committed
remove stringstream
1 parent 24c0d69 commit 96849b6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/simplex.pybind.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,10 @@ void add_simplex_module(py::module& root) {
253253
"decode",
254254
[](SimplexDecoder& self, const py::array_t<bool>& syndrome) {
255255
if ((size_t)syndrome.size() != self.num_detectors) {
256-
std::ostringstream msg;
257-
msg << "Syndrome array size (" << syndrome.size()
258-
<< ") does not match the number of detectors in the decoder ("
259-
<< self.num_detectors << ").";
260-
throw std::invalid_argument(msg.str());
256+
std::string msg = "Syndrome array size (" + std::to_string(syndrome.size()) +
257+
") does not match the number of detectors in the decoder (" +
258+
std::to_string(self.num_detectors) + ").";
259+
throw std::invalid_argument(msg);
261260
}
262261

263262
std::vector<uint64_t> detections;

src/tesseract.pybind.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ void add_tesseract_module(py::module& root) {
253253
msg << "Syndrome array size (" << syndrome.size()
254254
<< ") does not match the number of detectors in the decoder ("
255255
<< self.num_detectors << ").";
256-
std::string msg = "Syndrome array size (" + std:to_string(syndrome.size())
257-
+ ") does not match the number of detectors in the decoder ("
258-
+ std::to_string(self.num_detectors) + ")."
259-
throw std::invalid_argument(msg);
256+
std::string msg = "Syndrome array size (" +
257+
std
258+
: to_string(syndrome.size()) +
259+
") does not match the number of detectors in the decoder (" +
260+
std::to_string(self.num_detectors) + ")." throw std::invalid_argument(msg);
260261
}
261262

262263
std::vector<uint64_t> detections;

0 commit comments

Comments
 (0)