Use const-references in lots of places (preformance-unnecessary-value-param)

This commit is contained in:
Tim Wojtulewicz 2020-02-11 14:11:18 -08:00
parent 92afe64525
commit 5a237d3a3f
27 changed files with 89 additions and 89 deletions

View file

@ -386,7 +386,7 @@ bool Manager::DisableStream(EnumVal* id)
// Helper for recursive record field unrolling.
bool Manager::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt,
TableVal* include, TableVal* exclude, string path, list<int> indices)
TableVal* include, TableVal* exclude, const string& path, const list<int>& indices)
{
// Only include extensions for the outer record.
int num_ext_fields = (indices.size() == 0) ? filter->num_ext_fields : 0;
@ -676,7 +676,7 @@ bool Manager::RemoveFilter(EnumVal* id, StringVal* name)
return RemoveFilter(id, name->AsString()->CheckString());
}
bool Manager::RemoveFilter(EnumVal* id, string name)
bool Manager::RemoveFilter(EnumVal* id, const string& name)
{
Stream* stream = FindStream(id);
if ( ! stream )
@ -1259,7 +1259,7 @@ void Manager::DeleteVals(int num_fields, threading::Value** vals)
delete [] vals;
}
bool Manager::WriteFromRemote(EnumVal* id, EnumVal* writer, string path, int num_fields,
bool Manager::WriteFromRemote(EnumVal* id, EnumVal* writer, const string& path, int num_fields,
threading::Value** vals)
{
Stream* stream = FindStream(id);

View file

@ -112,7 +112,7 @@ public:
* This methods corresponds directly to the internal BiF defined in
* logging.bif, which just forwards here.
*/
bool RemoveFilter(EnumVal* id, string name);
bool RemoveFilter(EnumVal* id, const string& name);
/**
* Write a record to a log stream.
@ -165,7 +165,7 @@ public:
* @param vals An array of log values to write, of size num_fields.
* The method takes ownership of the array.
*/
bool WriteFromRemote(EnumVal* stream, EnumVal* writer, string path,
bool WriteFromRemote(EnumVal* stream, EnumVal* writer, const string& path,
int num_fields, threading::Value** vals);
/**
@ -256,7 +256,7 @@ private:
struct WriterInfo;
bool TraverseRecord(Stream* stream, Filter* filter, RecordType* rt,
TableVal* include, TableVal* exclude, string path, list<int> indices);
TableVal* include, TableVal* exclude, const string& path, const list<int>& indices);
threading::Value** RecordToFilterVals(Stream* stream, Filter* filter,
RecordVal* columns);