Skip to content

Commit 2ddc995

Browse files
authored
[gpad] simplify check if npoints is zero
1 parent 68b06d4 commit 2ddc995

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graf2d/gpad/src/TPad.cxx

+5-4
Original file line numberDiff line numberDiff line change
@@ -949,16 +949,17 @@ Int_t TPad::ClippingCode(Double_t x, Double_t y, Double_t xcl1, Double_t ycl1, D
949949

950950
Int_t TPad::ClipPolygon(Int_t n, Double_t *x, Double_t *y, Int_t nn, Double_t *xc, Double_t *yc, Double_t xclipl, Double_t yclipb, Double_t xclipr, Double_t yclipt)
951951
{
952+
if (n <= 0)
953+
return 0;
954+
952955
Int_t nc, nc2;
953956
Double_t x1, y1, x2, y2, slope; // Segment to be clipped
954957

955958
std::vector<Double_t> xc2(nn), yc2(nn);
956959

957960
// Clip against the left boundary
958-
if (n > 0) {
959-
x1 = x[n - 1];
960-
y1 = y[n - 1];
961-
}
961+
x1 = x[n - 1];
962+
y1 = y[n - 1];
962963
nc2 = 0;
963964
Int_t i;
964965
for (i = 0; i < n; i++) {

0 commit comments

Comments
 (0)