From 7c957bc1f129bb22c55399a60f54ce3b32aec404 Mon Sep 17 00:00:00 2001
From: Sergey Linev <S.Linev@gsi.de>
Date: Fri, 12 Jul 2019 17:18:08 +0200
Subject: [PATCH] [http] small sniffer optimization

use nullptr, reduce includes, remove unnecessary initializer
---
 net/http/inc/TRootSniffer.h            | 4 ++--
 net/http/src/TRootSniffer.cxx          | 4 ++--
 net/httpsniff/src/TRootSnifferFull.cxx | 1 -
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/http/inc/TRootSniffer.h b/net/http/inc/TRootSniffer.h
index 5c8e7a1d0af..3a8800fefe3 100644
--- a/net/http/inc/TRootSniffer.h
+++ b/net/http/inc/TRootSniffer.h
@@ -43,8 +43,8 @@ protected:
    UInt_t fMask{0};                       ///<! defines operation kind
    const char *fSearchPath{nullptr};      ///<! current path searched
    Int_t fLevel{0};                       ///<! current level of hierarchy
-   TString fItemName{};                   ///<! name of current item
-   TList fItemsNames{};                   ///<! list of created items names, need to avoid duplication
+   TString fItemName;                     ///<! name of current item
+   TList fItemsNames;                     ///<! list of created items names, need to avoid duplication
    Int_t fRestriction{0};                 ///<! restriction 0 - default, 1 - read-only, 2 - full access
 
    TRootSnifferStore *fStore{nullptr}; ///<! object to store results
diff --git a/net/http/src/TRootSniffer.cxx b/net/http/src/TRootSniffer.cxx
index 3130fe6026a..0515951dcb7 100644
--- a/net/http/src/TRootSniffer.cxx
+++ b/net/http/src/TRootSniffer.cxx
@@ -760,7 +760,7 @@ void TRootSniffer::ScanObjectChilds(TRootSnifferScanRec &rec, TObject *obj)
       ScanCollection(rec, ((TFolder *)obj)->GetListOfFolders());
    } else if (obj->InheritsFrom(TDirectory::Class())) {
       TDirectory *dir = (TDirectory *)obj;
-      ScanCollection(rec, dir->GetList(), 0, dir->GetListOfKeys());
+      ScanCollection(rec, dir->GetList(), nullptr, dir->GetListOfKeys());
    }
    if (rec.CanExpandItem()) {
       ScanObjectMembers(rec, obj->IsA(), (char *)obj);
@@ -1846,7 +1846,7 @@ Bool_t TRootSniffer::RegisterCommand(const char *cmdname, const char *method, co
    Int_t numargs = 0;
    do {
       TString nextname = TString::Format("%sarg%d%s", "%", numargs + 1, "%");
-      if (strstr(method, nextname.Data()) == 0)
+      if (strstr(method, nextname.Data()) == nullptr)
          break;
       numargs++;
    } while (numargs < 100);
diff --git a/net/httpsniff/src/TRootSnifferFull.cxx b/net/httpsniff/src/TRootSnifferFull.cxx
index 829cb86779b..33b7df6c47e 100644
--- a/net/httpsniff/src/TRootSnifferFull.cxx
+++ b/net/httpsniff/src/TRootSnifferFull.cxx
@@ -41,7 +41,6 @@
 #include "THttpCallArg.h"
 
 #include <stdlib.h>
-#include <vector>
 #include <string.h>
 
 //////////////////////////////////////////////////////////////////////////
-- 
GitLab