aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-03-06 23:27:29 +0100
committerEven Rouault <even.rouault@spatialys.com>2021-03-07 00:20:20 +0100
commitbef4d8fe2e388d569aee4f328629f4aa3e565ca8 (patch)
treefd706c192a21401ec44908e6da884c73029312a4 /src
parent43e123533412eb161bdd138917d78cf79a510fb6 (diff)
downloadPROJ-bef4d8fe2e388d569aee4f328629f4aa3e565ca8.tar.gz
PROJ-bef4d8fe2e388d569aee4f328629f4aa3e565ca8.zip
proj_info(): remove useless nullptr checking (CID 314807)
Diffstat (limited to 'src')
-rw-r--r--src/4D_api.cpp6
1 files changed, 3 insertions, 3 deletions
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<char*>(info.searchpath));
info.searchpath = buf ? buf : empty;
- info.paths = ctx ? ctx->c_compat_paths : nullptr;
- info.path_count = ctx ? static_cast<int>(ctx->search_paths.size()) : 0;
+ info.paths = ctx->c_compat_paths;
+ info.path_count = static_cast<int>(ctx->search_paths.size());
pj_release_lock ();
return info;