Parallel-NetCDF / PnetCDF

Source code repository of PnetCDF library and utilities
https://parallel-netcdf.github.io
Other
83 stars 23 forks source link

Reuse length of name string, instead of calling strlen #83

Closed wkliao closed 2 years ago

wkliao commented 2 years ago

In NetCDF format spec, object name consists of two parts: the number of characters and the character string itself, i.e.

    name = nelems namestring

where nelems is the length of namestring. This commit reuses nelems if it is previously calculated or already available in the file header, so to avoid calls to strlen().