Always pass the script string around by reference

This commit is contained in:
2019-06-13 17:37:23 +02:00
parent 10a2535c96
commit 601c4a3f89
7 changed files with 16 additions and 28 deletions

View File

@@ -1,7 +1,3 @@
#include <utility>
#include <utility>
#ifndef PORYGONLANG_BOUNDEXPRESSION_HPP
#define PORYGONLANG_BOUNDEXPRESSION_HPP
@@ -37,7 +33,7 @@ class BoundExpression{
const unsigned int _length;
const shared_ptr<ScriptType> _type;
public:
BoundExpression(unsigned int start, unsigned int length, shared_ptr<ScriptType> type)
BoundExpression(unsigned int start, unsigned int length, shared_ptr<ScriptType> type)
: _start(start),
_length(length),
_type(std::move(type))
@@ -47,7 +43,7 @@ public:
virtual ~BoundExpression() = default;
virtual const BoundExpressionKind GetKind() const = 0;
virtual const std::shared_ptr<ScriptType> GetType() const{
virtual const std::shared_ptr<ScriptType>& GetType() const{
return _type;
};