src/jsonpak/sorted

Search:
Group by:
Source   Edit  

Types

SortedJsonTree = distinct JsonTree
Source   Edit  

Procs

proc `==`(a, b: SortedJsonTree): bool {.inline, ...raises: [], tags: [],
                                        forbids: [].}
The equality comparison for SortedJsonTree is faster than the one for JsonTree. Source   Edit  
proc deduplicate(tree: var SortedJsonTree) {....raises: [], tags: [], forbids: [].}

Deduplicates keys in tree recursively. If duplicate keys are found, only the last occurrence of the key is kept.

The deduplication is performed in-place.

Source   Edit  
proc hash(tree: SortedJsonTree): Hash {....raises: [], tags: [], forbids: [].}
Repeatable and fast hashes Source   Edit  
proc sorted(tree: JsonTree): SortedJsonTree {.inline, ...raises: [], tags: [],
    forbids: [].}
Sorts all the keys of tree recursively, ensuring that the resulting tree has its keys in lexicographic order. Source   Edit