diff mbox series

[1/3] ctf-reader: Use argument by reference reading the context

Message ID 20211118232330.16310-2-guillermo.e.martinez@oracle.com
State New
Headers show
Series Some improvements in ctf-reader. | expand

Commit Message

Guillermo E. Martinez Nov. 18, 2021, 11:23 p.m. UTC
* 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: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
 include/abg-ctf-reader.h | 8 ++++----
 src/abg-ctf-reader.cc    | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

Comments

Dodji Seketeli Nov. 23, 2021, 2:26 p.m. UTC | #1
"Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a
écrit:

>  	* 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: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>

Applied to master.  Thanks!

[...]

Cheers,
diff mbox series

Patch

diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
index c0d8bb2b..56b2bf91 100644
--- a/include/abg-ctf-reader.h
+++ b/include/abg-ctf-reader.h
@@ -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
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 0370c8aa..2c2c204d 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -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);
 }