From 287197c4e33ca27a02188402543af0ba0286a5f5 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 3 Nov 2016 14:45:47 +0100 Subject: Depsgraph: Fully switch from string to const char* This brings up to 10-20% depsgraph build time improvement in the layout files from the studio repository. --- .../blender/depsgraph/intern/nodes/deg_node_component.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/depsgraph/intern/nodes/deg_node_component.h') diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index e0d425a2c14..ec2674a7b13 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -53,7 +53,7 @@ struct ComponentDepsNode : public DepsNode { struct OperationIDKey { eDepsOperation_Code opcode; - string name; + const char *name; int name_tag; OperationIDKey() @@ -67,7 +67,7 @@ struct ComponentDepsNode : public DepsNode { name_tag(-1) {} OperationIDKey(eDepsOperation_Code opcode, - const string &name, + const char *name, int name_tag) : opcode(opcode), name(name), @@ -85,7 +85,7 @@ struct ComponentDepsNode : public DepsNode { bool operator==(const OperationIDKey &other) const { return (opcode == other.opcode) && - (name == other.name) && + (STREQ(name, other.name)) && (name_tag == other.name_tag); } }; @@ -94,20 +94,20 @@ struct ComponentDepsNode : public DepsNode { ComponentDepsNode(); ~ComponentDepsNode(); - void init(const ID *id, const string &subdata); + void init(const ID *id, const char *subdata); string identifier() const; /* Find an existing operation, will throw an assert() if it does not exist. */ OperationDepsNode *find_operation(OperationIDKey key) const; OperationDepsNode *find_operation(eDepsOperation_Code opcode, - const string &name, + const char *name, int name_tag) const; /* Check operation exists and return it. */ OperationDepsNode *has_operation(OperationIDKey key) const; OperationDepsNode *has_operation(eDepsOperation_Code opcode, - const string &name, + const char *name, int name_tag) const; /** @@ -126,7 +126,7 @@ struct ComponentDepsNode : public DepsNode { OperationDepsNode *add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, - const string &name, + const char *name, int name_tag); void clear_operations(); @@ -206,7 +206,7 @@ struct PoseComponentDepsNode : public ComponentDepsNode { /* Bone Component */ struct BoneComponentDepsNode : public ComponentDepsNode { - void init(const ID *id, const string &subdata); + void init(const ID *id, const char *subdata); struct bPoseChannel *pchan; /* the bone that this component represents */ -- cgit v1.2.3