From adf256572957c38fba3b359108437aa1b3205bd1 Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Mon, 7 Mar 2022 10:47:43 +0100 Subject: [PATCH] tidy --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 88a67e8..6806923 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,8 +3,8 @@ #include "days/days.h" -std::vector getInput(int day, std::string key, bool useTestInput) { - std::vector result; +Input getInput(int day, std::string key, bool useTestInput) { + Input input; char dayStrPadded[3]; sprintf(dayStrPadded, "%02u", day); @@ -13,7 +13,7 @@ std::vector getInput(int day, std::string key, bool useTestInput) { if (!std::filesystem::exists({localFilePath})) { if (key.empty()) - return result; + return input; std::string dayStr = std::to_string(day); std::string url = "https://adventofcode.com/2021/day/" + dayStr + "/input"; std::cout << "Input does not exist. Fetching from " + url << std::endl; @@ -26,11 +26,11 @@ std::vector getInput(int day, std::string key, bool useTestInput) { std::string line; while (std::getline(file, line)) - result.push_back(line); + input.push_back(line); file.close(); - return result; + return input; } std::string getSessionKey() {