<commit_before>// ======================================================================
/*!
 * \file NFmiDataPool.cpp
 * \brief Implementation of class NFmiDataPool
 */
// ======================================================================
/*!
 * \class NFmiDataPool
 *
 * Undocumented
 *
 */
// ======================================================================

#include "NFmiDataPool.h"
#include "NFmiString.h"
#include "NFmiTransformList.h"

#include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <memory>
#include <stdexcept>
// memcpy()

using namespace std;

#include "NFmiVersion.h"

// ----------------------------------------------------------------------
/*!
 * Void constructor
 */
// ----------------------------------------------------------------------

NFmiDataPool::NFmiDataPool()
    : itsSize(0),
      itsIndex(-1),
      itsData(nullptr),
      fFirst(0),
      fLast(0),
      itsMinValue(kFloatMissing),
      itsMaxValue(kFloatMissing),
      itsMissingValueIndex(),
      itsCurrentMissingValueIndex(),
      itsMissingValue(),
      fUseBinaryStorage(false),
      fDoEndianByteSwap()
{
  ResetMissingValues();
  AddMissingValue(kFloatMissing);
}

// ----------------------------------------------------------------------
/*!
 * \param theDataPool Undocumented
 */
// ----------------------------------------------------------------------

NFmiDataPool::NFmiDataPool(const NFmiDataPool &theDataPool)
    : itsSize(theDataPool.itsSize),
      itsIndex(theDataPool.itsIndex),
      itsData(nullptr),
      fFirst(0),
      fLast(0),
      itsMinValue(theDataPool.itsMinValue),
      itsMaxValue(theDataPool.itsMaxValue),
      itsMissingValueIndex(),
      itsCurrentMissingValueIndex(),
      itsMissingValue(),
      fUseBinaryStorage(theDataPool.fUseBinaryStorage),
      fDoEndianByteSwap()
{
  Init(itsSize, theDataPool.itsData);
  InitMissingValues(theDataPool);
}

// ----------------------------------------------------------------------
/*!
 *
 */
// ----------------------------------------------------------------------
void NFmiDataPool::Destroy()
{
  if (itsData)
  {
    delete[] itsData;
    itsData = nullptr;
  }
}

// ----------------------------------------------------------------------<commit_msg>Applied clang-tidy modernize-use-bool-literals<commit_after>// ======================================================================
/*!
 * \file NFmiDataPool.cpp
 * \brief Implementation of class NFmiDataPool
 */
// ======================================================================
/*!
 * \class NFmiDataPool
 *
 * Undocumented
 *
 */
// ======================================================================

#include "NFmiDataPool.h"
#include "NFmiString.h"
#include "NFmiTransformList.h"

#include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <memory>
#include <stdexcept>
// memcpy()

using namespace std;

#include "NFmiVersion.h"

// ----------------------------------------------------------------------
/*!
 * Void constructor
 */
// ----------------------------------------------------------------------

NFmiDataPool::NFmiDataPool()
    : itsSize(0),
      itsIndex(-1),
      itsData(nullptr),
      fFirst(false),
      fLast(false),
      itsMinValue(kFloatMissing),
      itsMaxValue(kFloatMissing),
      itsMissingValueIndex(),
      itsCurrentMissingValueIndex(),
      itsMissingValue(),
      fUseBinaryStorage(false),
      fDoEndianByteSwap()
{
  ResetMissingValues();
  AddMissingValue(kFloatMissing);
}

// ----------------------------------------------------------------------
/*!
 * \param theDataPool Undocumented
 */
// ----------------------------------------------------------------------

NFmiDataPool::NFmiDataPool(const NFmiDataPool &theDataPool)
    : itsSize(theDataPool.itsSize),
      itsIndex(theDataPool.itsIndex),
      itsData(nullptr),
      fFirst(false),
      fLast(false),
      itsMinValue(theDataPool.itsMinValue),
      itsMaxValue(theDataPool.itsMaxValue),
      itsMissingValueIndex(),
      itsCurrentMissingValueIndex(),
      itsMissingValue(),
      fUseBinaryStorage(theDataPool.fUseBinaryStorage),
      fDoEndianByteSwap()
{
  Init(itsSize, theDataPool.itsData);
  InitMissingValues(theDataPool);
}

// ----------------------------------------------------------------------
/*!
 *
 */
// ----------------------------------------------------------------------
void NFmiDataPool::Destroy()
{
  if (itsData)
  {
    delete[] itsData;
    itsData = nullptr;
  }
}

// ----------------------------------------------------------------------
{'fraction_non_alphanumeric': 0.4005207203297895, 'fraction_numerical': 0.0017357344326318074, 'mean_word_length': 1.6880466472303206, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6477774', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1122, 'n_words': 164}