[Bf-blender-cvs] [2464395] master: Depsgraph: Avoid unnecessary char*/string conversion when creating RNAPathKey

Sergey Sharybin noreply at git.blender.org
Mon May 25 15:05:53 CEST 2015


Commit: 2464395b6d74ecad71e10c990f30ca20ef73b68c
Author: Sergey Sharybin
Date:   Mon May 25 18:05:19 2015 +0500
Branches: master
https://developer.blender.org/rB2464395b6d74ecad71e10c990f30ca20ef73b68c

Depsgraph: Avoid unnecessary char*/string conversion when creating RNAPathKey

===================================================================

M	source/blender/depsgraph/intern/depsgraph_build.h
M	source/blender/depsgraph/intern/depsgraph_build_relations.cc

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph_build.h b/source/blender/depsgraph/intern/depsgraph_build.h
index 93fa9e4..4088a32 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -220,7 +220,7 @@ struct OperationKey
 struct RNAPathKey
 {
 	// Note: see depsgraph_build.cpp for implementation
-	RNAPathKey(ID *id, const string &path);
+	RNAPathKey(ID *id, const char *path);
 
 	RNAPathKey(ID *id, const PointerRNA &ptr, PropertyRNA *prop) :
 	    id(id), ptr(ptr), prop(prop)
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cc b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
index a3319e7..5d51bfe 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
@@ -108,7 +108,7 @@ extern "C" {
 
 /* **** General purpose functions ****  */
 
-RNAPathKey::RNAPathKey(ID *id, const string &path) :
+RNAPathKey::RNAPathKey(ID *id, const char *path) :
     id(id)
 {
 	/* create ID pointer for root of path lookup */
@@ -116,7 +116,7 @@ RNAPathKey::RNAPathKey(ID *id, const string &path) :
 	RNA_id_pointer_create(id, &id_ptr);
 	/* try to resolve path... */
 	int index;
-	if (!RNA_path_resolve_full(&id_ptr, path.c_str(), &this->ptr, &this->prop, &index)) {
+	if (!RNA_path_resolve_full(&id_ptr, path, &this->ptr, &this->prop, &index)) {
 		this->ptr = PointerRNA_NULL;
 		this->prop = NULL;
 	}




More information about the Bf-blender-cvs mailing list