Skip to content

Commit ef37881

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Remove local ostringstream loc variable from ExceptionObject
The name `loc` was somewhat confusing here, as it is used elsewhere in ExceptionObject as the parameter name for the `ITK_LOCATION` argument (the name or signature of the function that threw the exception). Moreover, the use of a string stream is no longer necessary, now that we can use `std::to_string`.
1 parent 575f595 commit ef37881

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Modules/Core/Common/src/itkExceptionObject.cxx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ class ExceptionObject::ExceptionData
4141
, m_File(std::move(file))
4242
, m_Line(line)
4343
{
44-
std::ostringstream loc;
45-
46-
loc << ':' << m_Line << ":\n";
4744
m_What = m_File;
48-
m_What += loc.str();
45+
m_What += ':' + std::to_string(m_Line) + ":\n";
4946
m_What += m_Description;
5047
}
5148

0 commit comments

Comments
 (0)