Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
TYMorningCoffee
· 1y ago · 0 comments
Good point. It should be replaced with an if not empty check.
Comments
[–]
sedatk
1y ago
An empty check wouldn't be thread-safe either.
[–]
vips7L
1y ago
Hmm I don’t think we know that from the post. The list of unrelated objects could be immutable or mutable and never modified. An isEmpty check is 100% safe to be called concurrently in both those situations