From bef4d8fe2e388d569aee4f328629f4aa3e565ca8 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 6 Mar 2021 23:27:29 +0100 Subject: proj_info(): remove useless nullptr checking (CID 314807) --- src/4D_api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/4D_api.cpp') diff --git a/src/4D_api.cpp b/src/4D_api.cpp index 909c3c32..9c5b45f5 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -1610,7 +1610,7 @@ PJ_INFO proj_info (void) { /* build search path string */ auto ctx = pj_get_default_ctx(); - if (!ctx || ctx->search_paths.empty()) { + if (ctx->search_paths.empty()) { const auto searchpaths = pj_get_default_searchpaths(ctx); for( const auto& path: searchpaths ) { buf = path_append(buf, path.c_str(), &buf_size); @@ -1624,8 +1624,8 @@ PJ_INFO proj_info (void) { free(const_cast(info.searchpath)); info.searchpath = buf ? buf : empty; - info.paths = ctx ? ctx->c_compat_paths : nullptr; - info.path_count = ctx ? static_cast(ctx->search_paths.size()) : 0; + info.paths = ctx->c_compat_paths; + info.path_count = static_cast(ctx->search_paths.size()); pj_release_lock (); return info; -- cgit v1.2.3