optimize cxJsonCompare in case both value pointers are identical

Sat, 13 Dec 2025 16:47:07 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 13 Dec 2025 16:47:07 +0100
changeset 1592
c1e17411004f
parent 1591
ef2f47fc5f0c
child 1593
0df5128ab675

optimize cxJsonCompare in case both value pointers are identical

src/json.c file | annotate | diff | comparison | revisions
--- a/src/json.c	Sat Dec 13 16:41:10 2025 +0100
+++ b/src/json.c	Sat Dec 13 16:47:07 2025 +0100
@@ -1444,7 +1444,7 @@
 }
 
 int cxJsonCompare(const CxJsonValue *json, const CxJsonValue *other) {
-    if (json == NULL && other == NULL) return 0;
+    if (json == other) return 0;
     if (json == NULL || other == NULL) return -1;
     if (json->type != other->type) {
         if (!cxJsonIsNumber(json)) return -1;

mercurial