The default is a default, not a ceiling: an explicit request is honored up * to the (env-adjustable) ceiling; only a missing/invalid request falls back * to DEFAULT_MAX_NODES. */
| 197 | * to the (env-adjustable) ceiling; only a missing/invalid request falls back |
| 198 | * to DEFAULT_MAX_NODES. */ |
| 199 | static int clamp_max_nodes(int requested) { |
| 200 | int cap = render_node_limit(); |
| 201 | if (requested <= 0) { |
| 202 | requested = DEFAULT_MAX_NODES; |
| 203 | } |
| 204 | if (requested > cap) { |
| 205 | return cap; |
| 206 | } |
| 207 | return requested; |
| 208 | } |
| 209 | |
| 210 | /* ── Barnes-Hut Octree ────────────────────────────────────────── */ |
| 211 |
no test coverage detected