diff --git a/hist/hist/src/TH2.cxx b/hist/hist/src/TH2.cxx index a4320ee5c575c..dfd5df93f51be 100644 --- a/hist/hist/src/TH2.cxx +++ b/hist/hist/src/TH2.cxx @@ -262,19 +262,20 @@ Int_t TH2::BufferEmpty(Int_t action) const bool xbinAuto = fXaxis.GetXmax() <= fXaxis.GetXmin(); const bool ybinAuto = fYaxis.GetXmax() <= fYaxis.GetXmin(); - if (CanExtendAllAxes() || xbinAuto || ybinAuto) { + const bool extend = CanExtendAllAxes(); + if (extend || xbinAuto || ybinAuto) { //find min, max of entries in buffer - Double_t xmin = xbinAuto ? fBuffer[2] : fXaxis.GetXmin(); - Double_t xmax = xbinAuto ? xmin : fXaxis.GetXmax(); - Double_t ymin = ybinAuto ? fBuffer[3] : fYaxis.GetXmin(); - Double_t ymax = ybinAuto ? ymin : fYaxis.GetXmax(); + Double_t xmin = xbinAuto || extend ? fBuffer[2] : fXaxis.GetXmin(); + Double_t xmax = xbinAuto || extend ? xmin : fXaxis.GetXmax(); + Double_t ymin = ybinAuto || extend ? fBuffer[3] : fYaxis.GetXmin(); + Double_t ymax = ybinAuto || extend ? ymin : fYaxis.GetXmax(); for (Int_t i=1;i xmax) xmax = x; } - if (CanExtendAllAxes() || ybinAuto) { + if (extend || ybinAuto) { Double_t y = fBuffer[3*i+3]; if (y < ymin) ymin = y; if (y > ymax) ymax = y; diff --git a/hist/hist/src/TH3.cxx b/hist/hist/src/TH3.cxx index 61eeee9ac6fbc..de7a3de5e0aa7 100644 --- a/hist/hist/src/TH3.cxx +++ b/hist/hist/src/TH3.cxx @@ -245,26 +245,27 @@ Int_t TH3::BufferEmpty(Int_t action) const bool xbinAuto = fXaxis.GetXmax() <= fXaxis.GetXmin(); const bool ybinAuto = fYaxis.GetXmax() <= fYaxis.GetXmin(); const bool zbinAuto = fZaxis.GetXmax() <= fZaxis.GetXmin(); - if (CanExtendAllAxes() || xbinAuto || ybinAuto || zbinAuto) { + const bool extend = CanExtendAllAxes(); + if (extend || xbinAuto || ybinAuto || zbinAuto) { //find min, max of entries in buffer - Double_t xmin = xbinAuto ? fBuffer[2] : fXaxis.GetXmin(); - Double_t xmax = xbinAuto ? xmin : fXaxis.GetXmax(); - Double_t ymin = ybinAuto ? fBuffer[3] : fYaxis.GetXmin(); - Double_t ymax = ybinAuto ? ymin : fYaxis.GetXmax(); - Double_t zmin = zbinAuto ? fBuffer[4] : fZaxis.GetXmin(); - Double_t zmax = zbinAuto ? zmin : fZaxis.GetXmax(); + Double_t xmin = xbinAuto || extend ? fBuffer[2] : fXaxis.GetXmin(); + Double_t xmax = xbinAuto || extend ? xmin : fXaxis.GetXmax(); + Double_t ymin = ybinAuto || extend ? fBuffer[3] : fYaxis.GetXmin(); + Double_t ymax = ybinAuto || extend ? ymin : fYaxis.GetXmax(); + Double_t zmin = zbinAuto || extend ? fBuffer[4] : fZaxis.GetXmin(); + Double_t zmax = zbinAuto || extend ? zmin : fZaxis.GetXmax(); for (Int_t i=1;i xmax) xmax = x; } - if (CanExtendAllAxes() || ybinAuto) { + if (extend || ybinAuto) { Double_t y = fBuffer[4*i+3]; if (y < ymin) ymin = y; if (y > ymax) ymax = y; } - if (CanExtendAllAxes() || zbinAuto) { + if (extend || zbinAuto) { Double_t z = fBuffer[4*i+4]; if (z < zmin) zmin = z; if (z > zmax) zmax = z;