diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 10:47:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-12 10:11:34 +0200 |
commit | 992a33313046f4a4d322db9464c474e7429a019a (patch) | |
tree | 494143e3070af872027ecaca840516d3101a881c /sal/osl/unx/module.cxx | |
parent | convert SwComparePosition to scoped enum (diff) | |
download | core-992a33313046f4a4d322db9464c474e7429a019a.tar.gz core-992a33313046f4a4d322db9464c474e7429a019a.zip |
clang-tidy: readability-else-after-return
run it against sal,cppu,cppuhelper
I had to run this multiple times to catch all the cases in each module,
and it requires some hand-tweaking of the resulting output - clang-tidy
is not very good about cleaning up trailing spaces, and aligning
things nicely.
Change-Id: I00336345f5f036e12422b98d66526509380c497a
Reviewed-on: https://gerrit.libreoffice.org/36194
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/unx/module.cxx')
-rw-r--r-- | sal/osl/unx/module.cxx | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx index d99abc32fd04..207b0379a924 100644 --- a/sal/osl/unx/module.cxx +++ b/sal/osl/unx/module.cxx @@ -172,28 +172,27 @@ oslModule osl_loadModuleRelativeAscii( assert(relativePath && "illegal argument"); if (relativePath[0] == '/') { return osl_loadModuleAscii(relativePath, mode); - } else { - rtl_String * path = nullptr; - rtl_String * suffix = nullptr; - oslModule module; - if (!getModulePathFromAddress( - reinterpret_cast< void * >(baseModule), &path)) - { - return nullptr; - } - rtl_string_newFromStr_WithLength( - &path, path->buffer, - (rtl_str_lastIndexOfChar_WithLength(path->buffer, path->length, '/') - + 1)); - /* cut off everything after the last slash; should the original path - contain no slash, the resulting path is the empty string */ - rtl_string_newFromStr(&suffix, relativePath); - rtl_string_newConcat(&path, path, suffix); - rtl_string_release(suffix); - module = osl_loadModuleAscii(path->buffer, mode); - rtl_string_release(path); - return module; } + rtl_String * path = nullptr; + rtl_String * suffix = nullptr; + oslModule module; + if (!getModulePathFromAddress( + reinterpret_cast< void * >(baseModule), &path)) + { + return nullptr; + } + rtl_string_newFromStr_WithLength( + &path, path->buffer, + (rtl_str_lastIndexOfChar_WithLength(path->buffer, path->length, '/') + + 1)); + /* cut off everything after the last slash; should the original path + contain no slash, the resulting path is the empty string */ + rtl_string_newFromStr(&suffix, relativePath); + rtl_string_newConcat(&path, path, suffix); + rtl_string_release(suffix); + module = osl_loadModuleAscii(path->buffer, mode); + rtl_string_release(path); + return module; } #endif // !DISABLE_DYNLOADING |