[Bf-blender-cvs] [aef9243ebb4] master: Cleanup: remove unnecessary vars in RNA token reading

Campbell Barton noreply at git.blender.org
Thu Dec 10 07:03:55 CET 2020


Commit: aef9243ebb4f3d97d4d9f0eb731250a8c6c1db28
Author: Campbell Barton
Date:   Thu Dec 10 14:52:11 2020 +1100
Branches: master
https://developer.blender.org/rBaef9243ebb4f3d97d4d9f0eb731250a8c6c1db28

Cleanup: remove unnecessary vars in RNA token reading

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

M	source/blender/makesrna/intern/rna_access.c

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

diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 67f88d31afd..70b4d4204df 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4970,14 +4970,8 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
 
     p = *path;
 
-    /* 2 kinds of lookups now, quoted or unquoted */
-    char quote = *p;
-
-    if (quote != '"') {
-      quote = 0;
-    }
-
-    if (quote == 0) {
+    /* 2 kinds of look-ups now, quoted or unquoted. */
+    if (*p != '"') {
       while (*p && (*p != ']')) {
         len++;
         p++;
@@ -4985,10 +4979,10 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
     }
     else {
       bool escape = false;
-      /* skip the first quote */
+      /* Skip the first quote. */
       len++;
       p++;
-      while (*p && (*p != quote || escape)) {
+      while (*p && (*p != '"' || escape)) {
         /* A pair of back-slashes represents a single back-slash,
          * only use a single back-slash for escaping. */
         escape = (escape == false) && (*p == '\\');
@@ -4996,7 +4990,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int
         p++;
       }
 
-      /* skip the last quoted char to get the ']' */
+      /* Skip the last quoted char to get the `]`. */
       len++;
       p++;
     }



More information about the Bf-blender-cvs mailing list