Skip to content

Commit fac77fb

Browse files
committed
Document cycle safeguards (#25)
Clarify that cycle creation via add is prevented, removing the old to_s/size infinite-loop risk, and point readers to validate_acyclic!/acyclic? for untrusted input checks.
1 parent e4bccad commit fac77fb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

History.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* Treat `nil` child slots as empty in sibling/child checks to avoid phantom
88
nodes in sparse binary trees.
99

10+
* Add explicit cycle validation helpers (`validate_acyclic!`, `acyclic?`) for
11+
untrusted input.
12+
13+
* Cycle prevention in `add` eliminates the earlier `to_s`/`size` infinite-loop
14+
risk caused by cyclic graphs.
15+
1016
### 2.2.1pre / 2026-02-07
1117

1218
* Simplified development dependency constraints while maintaining Ruby 2.7+

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ See [History](./History.md) for the detailed Changelog.
4444
See [API-CHANGES](./API-CHANGES.md) for the detailed description of
4545
API level changes.
4646

47+
Cycle creation via `add` is prevented, and explicit cycle validation helpers
48+
are available for untrusted input (see `validate_acyclic!` and `acyclic?`).
49+
4750
## GETTING STARTED: ##
4851

4952
This is a basic usage example of the library to create and manipulate a tree.

0 commit comments

Comments
 (0)