<commit_before>// @(#)root/base:$Id$
// Author: <NAME>  13/05/2003

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME>, <NAME> and al.           *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TFriendProxy                                                         //
//                                                                      //
// Concrete implementation of the proxy around a Friend Tree.           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TFriendProxy.h"
#include "TTree.h"
#include "TList.h"
#include "TFriendElement.h"

ClassImp(ROOT::TFriendProxy);

namespace ROOT {

   //------------------------------------------------------------------------------------
   TFriendProxy::TFriendProxy() : fDirector(0,-1), fIndex(-1)
   {
   }

   //------------------------------------------------------------------------------------
   TFriendProxy::TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index) :
      fDirector(0,-1), fIndex(index)
   {
      // Constructor.

      if (main) {
         TObject *obj = main->GetListOfFriends()->At(fIndex);
         TFriendElement *element = dynamic_cast<TFriendElement*>( obj );
         if (element) fDirector.SetTree(element->GetTree());
      }
      director->Attach(this);
   }

   //------------------------------------------------------------------------------------
   Long64_t TFriendProxy::GetReadEntry() const<commit_msg>Fix cov #36327 (deref null return)<commit_after>// @(#)root/base:$Id$
// Author: <NAME>  13/05/2003

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME>, <NAME> and al.           *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TFriendProxy                                                         //
//                                                                      //
// Concrete implementation of the proxy around a Friend Tree.           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TFriendProxy.h"
#include "TTree.h"
#include "TList.h"
#include "TFriendElement.h"

ClassImp(ROOT::TFriendProxy);

namespace ROOT {

   //------------------------------------------------------------------------------------
   TFriendProxy::TFriendProxy() : fDirector(0,-1), fIndex(-1)
   {
   }

   //------------------------------------------------------------------------------------
   TFriendProxy::TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index) :
      fDirector(0,-1), fIndex(index)
   {
      // Constructor.

      if (main && main->GetListOfFriends()) {
         TObject *obj = main->GetListOfFriends()->At(fIndex);
         TFriendElement *element = dynamic_cast<TFriendElement*>( obj );
         if (element) fDirector.SetTree(element->GetTree());
      }
      director->Attach(this);
   }

   //------------------------------------------------------------------------------------
   Long64_t TFriendProxy::GetReadEntry() const
{'fraction_non_alphanumeric': 0.34816941852117733, 'fraction_numerical': 0.012203876525484566, 'mean_word_length': 0.8635755684351315, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2748010', 'n_tokens_mistral': 855, 'n_tokens_neox': 783, 'n_words': 159}