small optimization for pool_addfileprovides

Should use less memory and be a tiny bit faster. The code is
a bit simpler as well.