Page MenuHomeFreeBSD

pctrie: drop meaningless neighbor check
ClosedPublic

Authored by dougm on Oct 24 2024, 9:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 12, 10:15 PM
Unknown Object (File)
Sat, Mar 1, 2:14 PM
Unknown Object (File)
Wed, Feb 26, 4:49 PM
Unknown Object (File)
Mon, Feb 24, 10:19 AM
Unknown Object (File)
Feb 7 2025, 4:46 PM
Unknown Object (File)
Feb 2 2025, 9:54 PM
Unknown Object (File)
Jan 31 2025, 1:22 AM
Unknown Object (File)
Jan 30 2025, 7:21 PM
Subscribers

Details

Summary

In PCTRIE_INSERT_LOOKUP_{G,L}E, there is a test - if two pointers are equal, replace one with a new value. The pointers can never be equal; one points to a struct pctrie_node and the other is the (void*) cast of a pointer to a field within a struct pctrie_node. So the tests and assignments can be removed with no effect.

If the assignments were made under some other conditions, they would only move the neighbor pointer one level up the tree, undoing the benefits of a neighbor update near the end of pctrie_insert_lookup_compount.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable