fix(builder): Sub-string check

Fixes #282
This commit is contained in:
Michael Carlberg 2016-12-30 20:34:13 +01:00
parent 18cf9df86c
commit dffdc6a20b

View File

@ -313,7 +313,7 @@ void builder::space() {
void builder::remove_trailing_space(size_t len) { void builder::remove_trailing_space(size_t len) {
if (len == 0_z || len > m_output.size()) { if (len == 0_z || len > m_output.size()) {
return; return;
} else if (string(m_output.rbegin() + len, m_output.rbegin()) == string(len, ' ')) { } else if (m_output.substr(m_output.size() - len) == string(len, ' ')) {
m_output.erase(m_output.size() - len); m_output.erase(m_output.size() - len);
} }
} }