| 1558 | } |
| 1559 | |
| 1560 | static bool application_index_args_equal(const char *left, const char *right) { |
| 1561 | if (!left || !right) { |
| 1562 | return false; |
| 1563 | } |
| 1564 | yyjson_doc *left_source = yyjson_read(left, strlen(left), 0); |
| 1565 | yyjson_doc *right_source = yyjson_read(right, strlen(right), 0); |
| 1566 | yyjson_mut_doc *left_copy = left_source ? yyjson_doc_mut_copy(left_source, NULL) : NULL; |
| 1567 | yyjson_mut_doc *right_copy = right_source ? yyjson_doc_mut_copy(right_source, NULL) : NULL; |
| 1568 | yyjson_mut_val *left_root = left_copy ? yyjson_mut_doc_get_root(left_copy) : NULL; |
| 1569 | yyjson_mut_val *right_root = right_copy ? yyjson_mut_doc_get_root(right_copy) : NULL; |
| 1570 | bool equal = application_index_args_normalize_defaults(left_root) && |
| 1571 | application_index_args_normalize_defaults(right_root) && |
| 1572 | yyjson_mut_equals(left_root, right_root); |
| 1573 | yyjson_mut_doc_free(left_copy); |
| 1574 | yyjson_mut_doc_free(right_copy); |
| 1575 | yyjson_doc_free(left_source); |
| 1576 | yyjson_doc_free(right_source); |
| 1577 | return equal; |
| 1578 | } |
| 1579 | |
| 1580 | /* Caller holds application->mutex. Keeping watcher ownership validation and |
| 1581 | * this admission in the same critical section closes the unwatch race. */ |
no test coverage detected