]> git.kaiwu.me - njs.git/commit
Refactored atom hash into orthogonal find and add operations.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 17 Feb 2026 00:16:12 +0000 (16:16 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 24 Feb 2026 16:16:21 +0000 (08:16 -0800)
commit4ff0a7c7a67021958e513910a5e3b15bf2ff9fc8
treee8ae1a2e780b63b7a465ef2894ae1e041f802aad
parent1dbce7d937df3e43406f1e27986344df46d5066a
Refactored atom hash into orthogonal find and add operations.

Previously, njs_atom_find_or_add() and njs_atom_find_or_add_string()
duplicated the lookup logic and coupled find with insert. Splitting
them into njs_atom_find() and njs_atom_add() separates concerns:
find does a pure lookup with raw bytes, add inserts a pre-built value.
src/njs_atom.c
src/njs_atom.h
src/njs_lexer.c