<commit_before>#include <iostream>
#include <string>
#include <utility>

#include "pool.h"

void Pool::add_machine(const Machine& new_machine)
{
    const std::string& machine_name = new_machine.get_name();

    std::cout << "Adding machine to pool: " << machine_name << std::endl;
    machines.insert(std::make_pair(machine_name, new_machine));
}

void Pool::add_job(const Job& new_job)
{
    const int job_id = new_job.get_id();
    const std::string& machine_name = new_job.get_machine();
    std::map<std::string, Machine>::iterator iter;

    std::cout << "Adding job to pool: " << job_id << " (" << machine_name << ")" << std::endl;
    jobs.insert(std::make_pair(job_id, new_job));

    iter = machines.find(machine_name);
    if (iter != machines.end()) {
        std::cout << "Adding job to machine: " << machine_name << std::endl;
        iter->second.add_job(new_job);
    }
}<commit_msg>Move iterator variable declaration to the point of use.<commit_after>#include <iostream>
#include <string>
#include <utility>

#include "pool.h"

void Pool::add_machine(const Machine& new_machine)
{
    const std::string& machine_name = new_machine.get_name();

    std::cout << "Adding machine to pool: " << machine_name << std::endl;
    machines.insert(std::make_pair(machine_name, new_machine));
}

void Pool::add_job(const Job& new_job)
{
    const int job_id = new_job.get_id();
    const std::string& machine_name = new_job.get_machine();

    std::cout << "Adding job to pool: " << job_id << " (" << machine_name << ")" << std::endl;
    jobs.insert(std::make_pair(job_id, new_job));

    std::map<std::string, Machine>::iterator iter = machines.find(machine_name);
    if (iter != machines.end()) {
        std::cout << "Adding job to machine: " << machine_name << std::endl;
        iter->second.add_job(new_job);
    }
}
{'fraction_non_alphanumeric': 0.16721311475409836, 'fraction_numerical': 0.0, 'mean_word_length': 4.40117994100295, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2570874', 'n_tokens_mistral': 619, 'n_tokens_neox': 607, 'n_words': 133}