systeminit / si

The System Initiative software
https://systeminit.com
Apache License 2.0
1.58k stars 261 forks source link

Remove all usage of serde_json::json![...] in node_hash node weight methods #4616

Closed jhelwig closed 1 month ago

jhelwig commented 1 month ago

The only reason we were using serde_json::json![...] was to have something to feed into the ContentHash hasher. We didn't need the JSON itself as anything other than a sequence of bytes.

Rather than spending the time to serialize everything as JSON, just to feed the string representation as a sequence of bytes to the hasher, we now feed the values in directly to the hasher as sequences of bytes, bypassing the JSON serialization entirely.