From b311a2656c248cf6dc01cd8f4c4532d1009b43fe Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 17 Aug 2021 01:15:20 +0200 Subject: [PATCH] Make Ref parameters references wherever possible in TiledWallData. --- tiled_wall/tiled_wall_data.cpp | 8 ++++---- tiled_wall/tiled_wall_data.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tiled_wall/tiled_wall_data.cpp b/tiled_wall/tiled_wall_data.cpp index 5912158..e1cd696 100644 --- a/tiled_wall/tiled_wall_data.cpp +++ b/tiled_wall/tiled_wall_data.cpp @@ -56,12 +56,12 @@ Ref TiledWallData::get_texture(const int index) const { return _textures.get(index); } -void TiledWallData::set_texture(const int index, const Ref texture) { +void TiledWallData::set_texture(const int index, const Ref &texture) { ERR_FAIL_INDEX(index, _textures.size()); _textures.set(index, texture); } -void TiledWallData::add_texture(const Ref texture) { +void TiledWallData::add_texture(const Ref &texture) { _textures.push_back(texture); } void TiledWallData::remove_texture(const int index) { @@ -100,12 +100,12 @@ Ref TiledWallData::get_flavour_texture(const int index) const { return _flavour_textures.get(index); } -void TiledWallData::set_flavour_texture(const int index, const Ref texture) { +void TiledWallData::set_flavour_texture(const int index, const Ref &texture) { ERR_FAIL_INDEX(index, _flavour_textures.size()); _flavour_textures.set(index, texture); } -void TiledWallData::add_flavour_texture(const Ref texture) { +void TiledWallData::add_flavour_texture(const Ref &texture) { _flavour_textures.push_back(texture); } void TiledWallData::remove_flavour_texture(const int index) { diff --git a/tiled_wall/tiled_wall_data.h b/tiled_wall/tiled_wall_data.h index 3589d85..0f49567 100644 --- a/tiled_wall/tiled_wall_data.h +++ b/tiled_wall/tiled_wall_data.h @@ -61,8 +61,8 @@ public: //textures Ref get_texture(const int index) const; - void set_texture(const int index, const Ref texture); - void add_texture(const Ref texture); + void set_texture(const int index, const Ref &texture); + void add_texture(const Ref &texture); void remove_texture(const int index); int get_texture_count() const; @@ -72,8 +72,8 @@ public: //flavour_textures Ref get_flavour_texture(const int index) const; - void set_flavour_texture(const int index, const Ref texture); - void add_flavour_texture(const Ref texture); + void set_flavour_texture(const int index, const Ref &texture); + void add_flavour_texture(const Ref &texture); void remove_flavour_texture(const int index); int get_flavour_texture_count() const;