Forum Discussion

dragonflymr's avatar
dragonflymr
Icon for Cirrostratus rankCirrostratus
Dec 14, 2015

Append to list stored in table key

Hi,

First of all I wonder if this is good idea to store list in sub/table key - considering performance nad memory consummatum. Let's say it could be list containing no more that 10 IPs.

Second I wonder if there is faster more elegant way to actually add new value to the list. My idea is:

 

set c_val [table lookup -subtable ip [IP::client_addr]]

lappend c_val $new_val

table set -subtable ip [IP::client_addr] $c_val

 

Seems to be a lot overhead here, so maybe there is better way?

Piotr