<commit_before>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/stllike/string.h>
#include "misc.h"

namespace config {

/**
 * A config state represents the current state of a config instance
 */
struct ConfigState
{
public:
    ConfigState()
        : md5(""),
          generation(0),
          internalRedeploy(false),
          applyOnRestart(false)
    { }
    ConfigState(const vespalib::string & md5sum, int64_t gen, bool internalRedeploy, bool applyOnRestart)
        : md5(md5sum),
          generation(gen),
          internalRedeploy(internalRedeploy),
          applyOnRestart(applyOnRestart)
    { }

    vespalib::string md5;
    int64_t generation;
    bool internalRedeploy;
    booln applyOnRestart;

    bool isNewerGenerationThan(const ConfigState & other) const {
        return isGenerationNewer(generation, other.generation);
    }

    bool hasDifferentPayloadFrom(const ConfigState & other) const {
        return (md5.compare(other.md5) != 0);
    }
};

} // namespace config<commit_msg>Fix typo<commit_after>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/stllike/string.h>
#include "misc.h"

namespace config {

/**
 * A config state represents the current state of a config instance
 */
struct ConfigState
{
public:
    ConfigState()
        : md5(""),
          generation(0),
          internalRedeploy(false),
          applyOnRestart(false)
    { }
    ConfigState(const vespalib::string & md5sum, int64_t gen, bool internalRedeploy, bool applyOnRestart)
        : md5(md5sum),
          generation(gen),
          internalRedeploy(internalRedeploy),
          applyOnRestart(applyOnRestart)
    { }

    vespalib::string md5;
    int64_t generation;
    bool internalRedeploy;
    bool applyOnRestart;

    bool isNewerGenerationThan(const ConfigState & other) const {
        return isGenerationNewer(generation, other.generation);
    }

    bool hasDifferentPayloadFrom(const ConfigState & other) const {
        return (md5.compare(other.md5) != 0);
    }
};

} // namespace config
{'fraction_non_alphanumeric': 0.0938337801608579, 'fraction_numerical': 0.016979445933869526, 'mean_word_length': 3.070909090909091, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2357205', 'n_tokens_mistral': 696, 'n_tokens_neox': 657, 'n_words': 172}