Skip to content

Commit

Permalink
Fix variable name to be more descriptive and avoid shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
speth authored and ischoegl committed Jul 18, 2023
1 parent c094c5c commit 3a5da3c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/base/SolutionArray.cpp
Expand Up @@ -303,29 +303,29 @@ vector<string> integerColumn(string name, const vector<long int>& comp,
if (csize <= rows) {
for (const auto& val : comp) {
data.push_back(val);
string name = boost::trim_copy(fmt::format(notation, val));
if (name[0] == '-') {
name = name.substr(1);
string formatted = boost::trim_copy(fmt::format(notation, val));
if (formatted[0] == '-') {
formatted = formatted.substr(1);
}
maxLen = std::max(maxLen, name.size());
maxLen = std::max(maxLen, formatted.size());
}
} else {
dots = (rows + 1) / 2;
for (int row = 0; row < dots; row++) {
data.push_back(comp[row]);
string name = boost::trim_copy(fmt::format(notation, comp[row]));
if (name[0] == '-') {
name = name.substr(1);
string formatted = boost::trim_copy(fmt::format(notation, comp[row]));
if (formatted[0] == '-') {
formatted = formatted.substr(1);
}
maxLen = std::max(maxLen, name.size());
maxLen = std::max(maxLen, formatted.size());
}
for (int row = csize - rows / 2; row < csize; row++) {
data.push_back(comp[row]);
string name = boost::trim_copy(fmt::format(notation, comp[row]));
if (name[0] == '-') {
name = name.substr(1);
string formatted = boost::trim_copy(fmt::format(notation, comp[row]));
if (formatted[0] == '-') {
formatted = formatted.substr(1);
}
maxLen = std::max(maxLen, name.size());
maxLen = std::max(maxLen, formatted.size());
}
}

Expand Down

0 comments on commit 3a5da3c

Please sign in to comment.