Skip to content
Snippets Groups Projects
Commit 783117e2 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Clarify search loop.

parent 627f4a83
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -2,6 +2,8 @@
#include "config.h"
#endif
#include <stdbool.h>
#include "dmemory.h"
#include "cdi.h"
#include "cdi_int.h"
......@@ -1497,8 +1499,10 @@ vlistHasTime(int vlistID)
if (!(CDI_Reduce_Dim && vlistptr->ntsteps == 1))
{
for (int varID = 0; varID < vlistptr->nvars; varID++)
if (vlistptr->vars[varID].timetype != TIME_CONSTANT)
size_t nvars = vlistptr->nvars > 0 ? (size_t) vlistptr->nvars : (size_t) 0;
var_t *restrict vars = vlistptr->vars;
for (size_t varID = 0; varID < nvars; varID++)
if (vars[varID].timetype != TIME_CONSTANT)
{
hastime = true;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment