Update clang-format to disallow single line for-loops

This commit is contained in:
Thraix committed 2026-08-23 12:12:53 +02:00
1 parent ab6c726ebc
commit 988c5552d0
22 files changed
+79 -40

No files matched your search

+2 -1
View File
@@ -68,7 +68,8 @@ namespace y$1::day11
std::getline(input, str);
std::stringstream ss{str};
ss >> "Starting items: ";
while (std::getline(ss, str, ',')) monkey.items.emplace_back(std::stoi(str));
while (std::getline(ss, str, ','))
monkey.items.emplace_back(std::stoi(str));
}
{ // operator
std::getline(input, str);
+2 -1
View File
@@ -77,7 +77,8 @@ namespace y$1::day13
Node node;
node.nodes = std::stoi(str.substr(index));
nodes.emplace_back(node);
while (str[index] >= '0' && str[index] <= '9') index++;
while (str[index] >= '0' && str[index] <= '9')
index++;
}
else
{
+4 -2
View File
@@ -131,7 +131,8 @@ namespace y$1::day22
if (input.directions[i] >= '0' && input.directions[i] <= '9')
{
int amount = std::stoi(&input.directions[i]);
while (input.directions[i] >= '0' && input.directions[i] <= '9') i++;
while (input.directions[i] >= '0' && input.directions[i] <= '9')
i++;
for (int j = 0; j < amount; j++)
{
@@ -219,7 +220,8 @@ namespace y$1::day22
if (input.directions[i] >= '0' && input.directions[i] <= '9')
{
int amount = std::stoi(&input.directions[i]);
while (input.directions[i] >= '0' && input.directions[i] <= '9') i++;
while (input.directions[i] >= '0' && input.directions[i] <= '9')
i++;
for (int j = 0; j < amount; j++)
{
+2 -1
View File
@@ -39,7 +39,8 @@ namespace y$1::day25
// Convert to base 5
std::string base5 = "";
int64_t numbers = log(base10) / log(5) + 1;
for (int i = 0; i < numbers + 1; i++) base5.push_back('0');
for (int i = 0; i < numbers + 1; i++)
base5.push_back('0');
int64_t base5Max = Pow(5, numbers - 2);
for (int i = 1; i < base5.size(); i++)