@@ -103,7 +103,7 @@ const std::vector<List *> &Compiler::lists() const
103103}
104104
105105/* ! Adds an instruction to the bytecode. */
106- void Compiler::addInstruction (Opcode opcode, std::initializer_list<unsigned int > args)
106+ void Compiler::addInstruction (Opcode opcode, const std::initializer_list<unsigned int > & args)
107107{
108108 impl->addInstruction (opcode, args);
109109}
@@ -165,7 +165,7 @@ void Compiler::addFunctionCall(BlockFunc f)
165165}
166166
167167/* ! Adds an argument to a procedure (custom block). */
168- void Compiler::addProcedureArg (std::string procCode, std::string argName)
168+ void Compiler::addProcedureArg (const std::string & procCode, const std::string & argName)
169169{
170170 if (impl->procedureArgs .find (procCode) != impl->procedureArgs .cend ()) {
171171 const auto &procedure = impl->procedureArgs [procCode];
@@ -261,7 +261,7 @@ unsigned int Compiler::constIndex(InputValue *value)
261261}
262262
263263/* ! Returns the index of the procedure code of the given block. */
264- unsigned int Compiler::procedureIndex (std::string proc)
264+ unsigned int Compiler::procedureIndex (const std::string & proc)
265265{
266266 auto it = std::find (impl->procedures .begin (), impl->procedures .end (), proc);
267267 if (it != impl->procedures .end ())
@@ -271,7 +271,7 @@ unsigned int Compiler::procedureIndex(std::string proc)
271271}
272272
273273/* ! Returns the index of the argument of the given procedure (custom block). */
274- long Compiler::procedureArgIndex (std::string procCode, std::string argName)
274+ long Compiler::procedureArgIndex (const std::string & procCode, const std::string & argName)
275275{
276276 if (impl->procedureArgs .count (procCode) == 0 ) {
277277 std::cout << " warning: could not find custom block '" << procCode << " '" << std::endl;
0 commit comments