Page MenuHomeFreeBSD

pctrie: drop meaningless neighbor check
ClosedPublic

Authored by dougm on Thu, Oct 24, 9:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 8:54 AM
Unknown Object (File)
Sun, Nov 10, 3:04 PM
Unknown Object (File)
Sun, Nov 10, 12:34 AM
Unknown Object (File)
Wed, Nov 6, 1:24 PM
Unknown Object (File)
Tue, Nov 5, 5:13 AM
Unknown Object (File)
Mon, Oct 28, 12:57 AM
Unknown Object (File)
Sun, Oct 27, 1:24 PM
Unknown Object (File)
Sun, Oct 27, 1:23 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