Skip to content

Commit 9ee8a02

Browse files
committed
pass by reference
1 parent e0e0b2f commit 9ee8a02

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/include/core/G3Reader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
class G3Reader : public G3Module {
1111
public:
12-
G3Reader(std::string filename, int n_frames_to_read = -1,
12+
G3Reader(const std::string &filename, int n_frames_to_read = -1,
1313
float timeout = -1., bool track_filename = false,
1414
size_t buffersize = 1024*1024);
15-
G3Reader(std::vector<std::string> filenames, int n_frames_to_read = -1,
15+
G3Reader(const std::vector<std::string> &filenames, int n_frames_to_read = -1,
1616
float timeout = -1., bool track_filename = false,
1717
size_t buffersize = 1024*1024);
1818
virtual ~G3Reader();
@@ -22,7 +22,7 @@ class G3Reader : public G3Module {
2222
off_t Tell();
2323

2424
private:
25-
void StartFile(std::string path);
25+
void StartFile(const std::string &path);
2626
bool prefix_file_;
2727
std::string cur_file_;
2828
std::deque<std::string> filename_;

core/src/G3Reader.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <dataio.h>
33
#include <G3Reader.h>
44

5-
G3Reader::G3Reader(std::string filename, int n_frames_to_read,
5+
G3Reader::G3Reader(const std::string &filename, int n_frames_to_read,
66
float timeout, bool track_filename, size_t buffersize) :
77
prefix_file_(false), stream_(nullptr), n_frames_to_read_(n_frames_to_read),
88
n_frames_read_(0), n_frames_cur_(0), timeout_(timeout),
@@ -12,7 +12,7 @@ G3Reader::G3Reader(std::string filename, int n_frames_to_read,
1212
StartFile(filename);
1313
}
1414

15-
G3Reader::G3Reader(std::vector<std::string> filename, int n_frames_to_read,
15+
G3Reader::G3Reader(const std::vector<std::string> &filename, int n_frames_to_read,
1616
float timeout, bool track_filename, size_t buffersize) :
1717
prefix_file_(false), stream_(nullptr), n_frames_to_read_(n_frames_to_read),
1818
n_frames_read_(0), n_frames_cur_(0), timeout_(timeout),
@@ -34,7 +34,7 @@ G3Reader::~G3Reader()
3434
g3_istream_close(stream_);
3535
}
3636

37-
void G3Reader::StartFile(std::string path)
37+
void G3Reader::StartFile(const std::string &path)
3838
{
3939
log_info("Starting file %s\n", path.c_str());
4040
cur_file_ = path;

0 commit comments

Comments
 (0)