[Bf-blender-cvs] [3f67e76bc24] temp-node-error-messages: Reduce string copying by passing reference
Hans Goudey
noreply at git.blender.org
Wed Feb 3 04:04:18 CET 2021
Commit: 3f67e76bc240bb9172a2ffa2e854d55cfead2b89
Author: Hans Goudey
Date: Tue Feb 2 21:04:10 2021 -0600
Branches: temp-node-error-messages
https://developer.blender.org/rB3f67e76bc240bb9172a2ffa2e854d55cfead2b89
Reduce string copying by passing reference
===================================================================
M source/blender/nodes/NOD_geometry_exec.hh
M source/blender/nodes/intern/node_geometry_exec.cc
===================================================================
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index 0e8b723af64..da3d6c6545b 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -183,7 +183,7 @@ class GeoNodeExecParams {
* Add an error message displayed at the bottom of the node when displaying the node tree,
* and potentially elsewhere in Blender.
*/
- void error_message_add(const eNodeWarningType type, const std::string message) const;
+ void error_message_add(const eNodeWarningType type, const std::string &message) const;
/**
* Creates a read-only attribute based on node inputs. The method automatically detects which
diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc
index 241b2f9cdfc..5def40ad153 100644
--- a/source/blender/nodes/intern/node_geometry_exec.cc
+++ b/source/blender/nodes/intern/node_geometry_exec.cc
@@ -22,7 +22,7 @@
namespace blender::nodes {
void GeoNodeExecParams::error_message_add(const eNodeWarningType type,
- const std::string message) const
+ const std::string &message) const
{
bNodeTree *original_ntree = (bNodeTree *)DEG_get_original_id(&(ID &)ntree_);
if (original_ntree != nullptr) {
More information about the Bf-blender-cvs
mailing list