Fix inconsistent string stream naming
This commit is contained in:
parent
bd5df5d019
commit
e6a132521b
|
@ -32,7 +32,7 @@ const int BridgeRepair::getPuzzleDay() const
|
|||
|
||||
void BridgeRepair::processDataLine(const std::string& line)
|
||||
{
|
||||
std::istringstream stringStream{ line };
|
||||
std::istringstream stream{ line };
|
||||
|
||||
long long int testValue;
|
||||
char colon;
|
||||
|
@ -41,8 +41,8 @@ void BridgeRepair::processDataLine(const std::string& line)
|
|||
// The precomputed numbers are used to facilitate the "concatenate" operator.
|
||||
std::vector<std::pair<int, int>> calibrationNumbers{};
|
||||
|
||||
stringStream >> testValue >> colon;
|
||||
while (stringStream >> calibrationNumber)
|
||||
stream >> testValue >> colon;
|
||||
while (stream >> calibrationNumber)
|
||||
{
|
||||
// Skips the precomputation for the first calibration numbers.
|
||||
int pow10{ 0 };
|
||||
|
|
|
@ -36,9 +36,9 @@ void PlutonianPebbles::processDataLine(const std::string& line)
|
|||
std::shared_ptr<std::map<long long int, long long int>> nextBlinkPebbles;
|
||||
|
||||
// Adds initial pebbles numbers.
|
||||
std::istringstream lineStream{ line };
|
||||
std::istringstream stream{ line };
|
||||
long long int pebbleNumber;
|
||||
while (lineStream >> pebbleNumber)
|
||||
while (stream >> pebbleNumber)
|
||||
{
|
||||
addPebble(*currentPebbles, pebbleNumber, 1);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ void PrintQueue::processOrderingRule(const std::string& line)
|
|||
void PrintQueue::processUpdatePages(const std::string& line)
|
||||
{
|
||||
std::vector<int> pages{};
|
||||
std::stringstream stream{ line };
|
||||
std::istringstream stream{ line };
|
||||
std::string token;
|
||||
bool isCorrectOrder{ true };
|
||||
// We completely construct 'pages' for part 2, even if the ordering is not correct.
|
||||
|
|
|
@ -35,7 +35,7 @@ void RedNosedReports::processDataLine(const std::string& line)
|
|||
{
|
||||
RedNosedReportData data{};
|
||||
|
||||
std::stringstream stream{ line };
|
||||
std::istringstream stream{ line };
|
||||
std::string token;
|
||||
std::getline(stream, token, ' ');
|
||||
data.levels.push_back(std::stoi(token));
|
||||
|
|
|
@ -24,14 +24,14 @@ Solver::Solver(const int inputFileNameSuffix)
|
|||
|
||||
const std::string Solver::getInputFileName() const
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << clean(getPuzzleName());
|
||||
std::ostringstream stream;
|
||||
stream << clean(getPuzzleName());
|
||||
if (inputFileNameSuffix_ > 0)
|
||||
{
|
||||
oss << "_" << inputFileNameSuffix_;
|
||||
stream << "_" << inputFileNameSuffix_;
|
||||
}
|
||||
oss << ".txt";
|
||||
return oss.str();
|
||||
stream << ".txt";
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
long long int Solver::getResultPart1() const
|
||||
|
|
Loading…
Reference in New Issue