mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-30 06:47:48 +00:00
Prefer pre-increment/decrement operators in for loops
This commit is contained in:
@@ -29,14 +29,14 @@ std::shared_ptr<std::string> MacroArgs::getAllArgs() const {
|
||||
|
||||
size_t len = 0;
|
||||
|
||||
for (uint32_t i = shift; i < nbArgs; i++) {
|
||||
for (uint32_t i = shift; i < nbArgs; ++i) {
|
||||
len += args[i]->length() + 1; // 1 for comma
|
||||
}
|
||||
|
||||
auto str = std::make_shared<std::string>();
|
||||
str->reserve(len + 1); // 1 for comma
|
||||
|
||||
for (uint32_t i = shift; i < nbArgs; i++) {
|
||||
for (uint32_t i = shift; i < nbArgs; ++i) {
|
||||
std::shared_ptr<std::string> const &arg = args[i];
|
||||
|
||||
str->append(*arg);
|
||||
|
||||
Reference in New Issue
Block a user