]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/ConfUtils: pass string_view instead of string 38754/head
authorKefu Chai <kchai@redhat.com>
Mon, 4 Jan 2021 09:22:09 +0000 (17:22 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 4 Jan 2021 09:29:58 +0000 (17:29 +0800)
commit65fa1c1e642f2a0620c11c2a1553105604652352
tree2097ab2c0d0cf10f426146305b9db1ccc58c8c6c
parentd2d1c23a51e2b0696a6c2fcafbb9fdd39698a7f0
common/ConfUtils: pass string_view instead of string

pass string_view as the section_name when reading options from a
ConfFile. as there is no need to create a temporary string object
if the section name is a `const char*` literal.

also, update the caller site in `common/config.cc` accordingly as a
cleanup. as it's not necessary to pass a `const char*` for the section
name even without this change.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/ConfUtils.cc
src/common/ConfUtils.h
src/common/config.cc