dnsjit.lib.trie.iter(3) | Library Functions Manual | dnsjit.lib.trie.iter(3) |
dnsjit.lib.trie.iter - Iterator of the trie.
local trie =
require("dnsjit.lib.trie").new("uint64_t")
local iter = trie:iter()
local node = iter:node()
while node ~= nil do
local key = node:key()
local value = tonumber(node:get())
print(key..": "..value)
iter:next()
node = iter:node()
end
Beware that iterator is only valid as long as the trie's key-set remains unchanged.
Iteration is in ascending lexicographical order. Empty string would be considered as the very first.
You may not use this function if the trie's key-set has been modified during the lifetime of the iterator (modifying only values is OK).
Jerry Lundström (DNS-OARC), Tomáš Křížek (CZ.NIC), Petr Špaček (ISC)
Maintained by DNS-OARC
For issues and feature requests please use:
For question and help please use:
1.2.3 | dnsjit |