Skip to content

Commit

Permalink
Return the indentation unit instead of an empty string with indent("",n)
Browse files Browse the repository at this point in the history
  • Loading branch information
irydacea committed Feb 16, 2014
1 parent f229367 commit dd9b53f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/serialization/string_utils.cpp
Expand Up @@ -747,16 +747,16 @@ bool wildcard_string_match(const std::string& str, const std::string& match) {

std::string indent(const std::string& string, size_t indent_size)
{
if(string.empty()) {
return "";
}

if(indent_size == 0) {
return string;
}

const std::string indent(indent_size, ' ');

if(string.empty()) {
return indent;
}

const std::vector<std::string>& lines = split(string, '\x0A', 0);
std::string res;

Expand Down

0 comments on commit dd9b53f

Please sign in to comment.