blobmsg: Don't do at run-time what can be done at compile-time
authorPhilip Prindeville <philipp@redfish-solutions.com>
Fri, 14 Apr 2023 18:37:06 +0000 (12:37 -0600)
committerAlexander Couzens <lynxis@fe80.eu>
Sun, 16 Apr 2023 12:53:11 +0000 (14:53 +0200)
commit5893cf78da4002eaf6caa01ff27134b3368c1161
tree6edd24a58aa906def325bdb6c330835e42cb0f8b
parent6fc29d1c429240a9afb71c22aa161b066502f3ed
blobmsg: Don't do at run-time what can be done at compile-time

Repeatedly calling a run-time function like strlen() on an
invariant value is inefficient, especially if that value can be
computed once (at initialization) or better yet, computed at
compile-time.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
blobmsg_json.c