ctf-reader: Use argument by reference reading the context

* include/abg-ctf-reader.h (create_read_context): Pass the string
	by reference.
	* src/abg-ctf-reader.cc (ctf_reader::read_context): Likewise.
	(create_read_context): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Guillermo E. Martinez via Libabigail 2021-11-17 20:56:04 -06:00 committed by Dodji Seketeli
parent 18569fc154
commit ab77eb0d50
2 changed files with 7 additions and 6 deletions

View File

@ -25,10 +25,10 @@ namespace ctf_reader
{
class read_context;
read_context *create_read_context (std::string elf_path,
ir::environment *env);
corpus_sptr read_corpus (read_context *ctxt,
elf_reader::status& status);
read_context *create_read_context(const std::string& elf_path,
ir::environment *env);
corpus_sptr read_corpus(read_context *ctxt,
elf_reader::status& status);
} // end namespace ctf_reader
} // end namespace abigail

View File

@ -102,7 +102,7 @@ public:
/// Constructor.
///
/// @param elf_path the path to the ELF file.
read_context(string elf_path, ir::environment *env)
read_context(const string& elf_path, ir::environment *env)
{
types_map.clear();
filename = elf_path;
@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
/// @param env a libabigail IR environment.
read_context *
create_read_context(std::string elf_path, ir::environment *env)
create_read_context(const std::string& elf_path,
ir::environment *env)
{
return new read_context(elf_path, env);
}