Calculating through the iterator may lead to unexpected problems. We already know the id of every database entry, so we might as well use it directly. Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>