Closed AlexGuteniev closed 1 year ago
Done in https://github.com/boostorg/stacktrace/commit/7c6778e9f4d43f29d215b3dd910a6fee6a3db840
@AlexGuteniev note that the docs for GetLineByOffset()
still have no This size includes the space for the '\0' terminating character.
, so I left the code as is for that call. The impact should be unnoticeable.
@apolukhin, I did a bulk fix of these https://github.com/MicrosoftDocs/windows-driver-docs-ddi/pull/1255 , but unfortunately missed this one 😕
Not sure if it is really needed, as perf gain and simplification are both very small.
Referring to this: https://github.com/boostorg/stacktrace/blob/75b7986f9799184ecd679d86273532cb54e6a0dc/include/boost/stacktrace/detail/frame_msvc.ipp#L222-L234
According to the updated IDebugSymbols::GetNameByOffset documentation, sizes will include the space for exactly one null terminator:
So the assignment in the else branch can be like:
and
trim_right_zeroes
can be avoided by resizing string asresult.resize(size - 1)
prior the second call.Ditto for
GetLineByOffset
below.