<commit_before>#include "BuddyMonitor.hpp"
#include <QDebug>

namespace Dissent {
namespace Anonymity {
namespace Buddies {
  BuddyMonitor::BuddyMonitor(const QSharedPointer<BuddyPolicy> &bp, int min_anon) :
    m_bp(bp),
    m_used_nyms(m_bp->GetCount(), false),
    m_min_anon(min_anon)
  {
    Q_ASSERT(m_bp);
    for(int idx = 0; idx < m_bp->GetCount(); idx++) {
      m_member_set.append(QBitArray(m_bp->GetCount(), true));
      m_nym_set.append(QBitArray(m_bp->GetCount(), true));
    }
  }

  void BuddyMonitor::SetOnlineMembers(const QBitArray &members)
  {
    m_bp->SetOnlineMembers(members);
  }

  QBitArray BuddyMonitor::GetUsefulMembers() const
  {
    return m_bp->GetUsefulMembers();
  }

  void BuddyMonitor::SetActiveNym(int idx)
  {
    m_used_nyms[idx] = true;
    QBitArray useful_members = m_bp->GetUsefulMembers();
    for(int jdx = 0; jdx < useful_members.count(); jdx++) {
      if(useful_members[jdx]) {
        continue;
      }
      m_member_set[jdx][idx] = false;
      m_nym_set[idx][jdx] = false;
    }
  }

  void BuddyMonitor::SetActiveNyms(const QBitArray &nyms)
  {
    for(int idx; idx < m_bp->GetCount(); idx++) {
      if(nyms[idx]) {
        SetActiveNym(idx);
      }
    }
  }

  QBitArray BuddyMonitor::ShouldRevealNyms(const QBitArray &nyms)
  {
    if(m_min_anon == 0) {
      return nyms;
    }

    Q_ASSERT(nyms.size() == m_bp->GetCount());
    QList<QBitArray> member_set = m_member_set;<commit_msg>add missing variable initialization<commit_after>#include "BuddyMonitor.hpp"
#include <QDebug>

namespace Dissent {
namespace Anonymity {
namespace Buddies {
  BuddyMonitor::BuddyMonitor(const QSharedPointer<BuddyPolicy> &bp, int min_anon) :
    m_bp(bp),
    m_used_nyms(m_bp->GetCount(), false),
    m_min_anon(min_anon)
  {
    Q_ASSERT(m_bp);
    for(int idx = 0; idx < m_bp->GetCount(); idx++) {
      m_member_set.append(QBitArray(m_bp->GetCount(), true));
      m_nym_set.append(QBitArray(m_bp->GetCount(), true));
    }
  }

  void BuddyMonitor::SetOnlineMembers(const QBitArray &members)
  {
    m_bp->SetOnlineMembers(members);
  }

  QBitArray BuddyMonitor::GetUsefulMembers() const
  {
    return m_bp->GetUsefulMembers();
  }

  void BuddyMonitor::SetActiveNym(int idx)
  {
    m_used_nyms[idx] = true;
    QBitArray useful_members = m_bp->GetUsefulMembers();
    for(int jdx = 0; jdx < useful_members.count(); jdx++) {
      if(useful_members[jdx]) {
        continue;
      }
      m_member_set[jdx][idx] = false;
      m_nym_set[idx][jdx] = false;
    }
  }

  void BuddyMonitor::SetActiveNyms(const QBitArray &nyms)
  {
    for(int idx = 0; idx < m_bp->GetCount(); idx++) {
      if(nyms[idx]) {
        SetActiveNym(idx);
      }
    }
  }

  QBitArray BuddyMonitor::ShouldRevealNyms(const QBitArray &nyms)
  {
    if(m_min_anon == 0) {
      return nyms;
    }

    Q_ASSERT(nyms.size() == m_bp->GetCount());
    QList<QBitArray> member_set = m_member_set;
{'fraction_non_alphanumeric': 0.1405608755129959, 'fraction_numerical': 0.0023939808481532147, 'mean_word_length': 3.5419254658385095, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, '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': '6800562', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1112, 'n_words': 171}