Commit e6ce7953 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Make assignment occur only once.

parent 54df264b
...@@ -4737,7 +4737,6 @@ void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva ...@@ -4737,7 +4737,6 @@ void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
{ {
int xdimids[2] = {-1,-1}, ydimids[2] = {-1,-1}; int xdimids[2] = {-1,-1}, ydimids[2] = {-1,-1};
int xdimid = -1, ydimid = -1; int xdimid = -1, ydimid = -1;
int xvarid = -1, yvarid = -1;
int islon = 0, islat = 0; int islon = 0, islat = 0;
int nxdims = 0, nydims = 0; int nxdims = 0, nydims = 0;
size_t size = 0, np = 0; size_t size = 0, np = 0;
...@@ -4777,15 +4776,12 @@ void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva ...@@ -4777,15 +4776,12 @@ void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
ydimid = ydimids[0]; ydimid = ydimids[0];
} }
if ( ncvars[ncvarid].xvarid != UNDEFID ) int xvarid = ncvars[ncvarid].xvarid != UNDEFID
xvarid = ncvars[ncvarid].xvarid; ? ncvars[ncvarid].xvarid
else if ( xdimid != UNDEFID ) : (xdimid != UNDEFID ? ncdims[xdimid].ncvarid : -1);
xvarid = ncdims[xdimid].ncvarid; int yvarid = ncvars[ncvarid].yvarid != UNDEFID
? ncvars[ncvarid].yvarid
if ( ncvars[ncvarid].yvarid != UNDEFID ) : (ydimid != UNDEFID ? ncdims[ydimid].ncvarid : -1);
yvarid = ncvars[ncvarid].yvarid;
else if ( ydimid != UNDEFID )
yvarid = ncdims[ydimid].ncvarid;
/* /*
if ( xdimid != UNDEFID ) if ( xdimid != UNDEFID )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment