zeek/scripts/base/utils
Benjamin Bannier d5fd29edcd Prefer explicit construction to coercion in record initialization
While we support initializing records via coercion from an expression
list, e.g.,

    local x: X = [$x1=1, $x2=2];

this can sometimes obscure the code to readers, e.g., when assigning to
value declared and typed elsewhere. The language runtime has a similar
overhead since instead of just constructing a known type it needs to
check at runtime that the coercion from the expression list is valid;
this can be slower than just writing the readible code in the first
place, see #4559.

With this patch we use explicit construction, e.g.,

    local x = X($x1=1, $x2=2);
2025-07-11 16:28:37 -07:00
..
active-http.zeek Prefer explicit construction to coercion in record initialization 2025-07-11 16:28:37 -07:00
addrs.zeek Reformat docs in addrs.zeek to fix doc generation 2021-09-14 19:26:28 -07:00
backtrace.zeek Add backtrace() and print_backtrace() 2020-07-03 14:09:31 -07:00
conn-ids.zeek flag base script as being known to ZAM optimization 2024-04-25 09:15:13 -07:00
dir.zeek Prefer explicit construction to coercion in record initialization 2025-07-11 16:28:37 -07:00
directions-and-hosts.zeek Remove trailing whitespace from script files 2021-10-20 09:57:09 -07:00
email.zeek UPDATED: improving email address splitting for common comma case 2022-08-05 17:38:54 -04:00
exec.zeek Prefer explicit construction to coercion in record initialization 2025-07-11 16:28:37 -07:00
files.zeek Rename all scripts to have ".zeek" file extension 2019-04-11 21:12:40 -05:00
geoip-distance.zeek More bro-to-zeek renaming in scripts and other files 2019-05-16 02:36:41 -05:00
hash_hrw.zeek Rename all scripts to have ".zeek" file extension 2019-04-11 21:12:40 -05:00
numbers.zeek Fix errors from rst linting on the generated docs 2025-01-24 11:41:36 -07:00
packages.zeek utils: Introduce packages.zeek with can_load() helper 2024-02-22 11:41:50 +01:00
paths.zeek Expand build_path() function to handle empty dir arguments gracefully 2022-05-19 09:45:52 -07:00
patterns.zeek Prefer explicit construction to coercion in record initialization 2025-07-11 16:28:37 -07:00
queue.zeek Rename all scripts to have ".zeek" file extension 2019-04-11 21:12:40 -05:00
site.zeek Add recommended non-routable subnets 2025-01-09 22:15:45 -07:00
strings.zeek strings: Implement join_string_set() as bif 2022-09-20 23:07:26 +02:00
thresholds.zeek Remove trailing whitespace from script files 2021-10-20 09:57:09 -07:00
time.zeek Introduce get_packet_lag() 2024-12-09 19:19:29 +01:00
urls.zeek Restore previous url scheme capture group 2020-04-14 16:33:19 -07:00